Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/lib/libipsec Pull up revision 1.12 via patch (requested...



details:   https://anonhg.NetBSD.org/src/rev/4bb58ce03523
branches:  netbsd-1-6
changeset: 530815:4bb58ce03523
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Oct 05 09:10:05 2003 +0000

description:
Pull up revision 1.12 via patch (requested by itojun in ticket #1507):
realloc error check failure; Greg Troxel, sync w/ kame

diffstat:

 lib/libipsec/policy_parse.y |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 843862e32788 -r 4bb58ce03523 lib/libipsec/policy_parse.y
--- a/lib/libipsec/policy_parse.y       Sat Oct 04 09:59:48 2003 +0000
+++ b/lib/libipsec/policy_parse.y       Sun Oct 05 09:10:05 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: policy_parse.y,v 1.7.2.2 2003/10/02 20:55:52 tron Exp $        */
+/*     $NetBSD: policy_parse.y,v 1.7.2.3 2003/10/05 09:10:05 tron Exp $        */
 /*     $KAME: policy_parse.y,v 1.10 2000/05/07 05:25:03 itojun Exp $   */
 
 /*
@@ -295,13 +295,13 @@
 {
        struct sadb_x_policy *p;
 
-       tlen = sizeof(struct sadb_x_policy);
-
        pbuf = malloc(tlen);
        if (pbuf == NULL) {
                __ipsec_errcode = EIPSEC_NO_BUFS;
                return -1;
        }
+       tlen = sizeof(struct sadb_x_policy);
+
        p = (struct sadb_x_policy *)pbuf;
        p->sadb_x_policy_len = 0;       /* must update later */
        p->sadb_x_policy_exttype = SADB_X_EXT_POLICY;
@@ -327,7 +327,7 @@
                + (dst ? dst->sa_len : 0);
 
        n = realloc(pbuf, tlen + reqlen);
-       if (pbuf == NULL) {
+       if (n == NULL) {
                __ipsec_errcode = EIPSEC_NO_BUFS;
                return -1;
        }



Home | Main Index | Thread Index | Old Index