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.11 (requested by itojun...
details: https://anonhg.NetBSD.org/src/rev/283e78fbdf60
branches: netbsd-1-6
changeset: 530801:283e78fbdf60
user: tron <tron%NetBSD.org@localhost>
date: Thu Oct 02 20:55:52 2003 +0000
description:
Pull up revision 1.11 (requested by itojun in ticket #1502):
correct unsafe use of realloc().
diffstat:
lib/libipsec/policy_parse.y | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (31 lines):
diff -r ae25dffbd91a -r 283e78fbdf60 lib/libipsec/policy_parse.y
--- a/lib/libipsec/policy_parse.y Thu Oct 02 20:46:39 2003 +0000
+++ b/lib/libipsec/policy_parse.y Thu Oct 02 20:55:52 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: policy_parse.y,v 1.7.2.1 2002/08/02 00:42:07 lukem Exp $ */
+/* $NetBSD: policy_parse.y,v 1.7.2.2 2003/10/02 20:55:52 tron Exp $ */
/* $KAME: policy_parse.y,v 1.10 2000/05/07 05:25:03 itojun Exp $ */
/*
@@ -320,17 +320,19 @@
{
struct sadb_x_ipsecrequest *p;
int reqlen;
+ caddr_t n;
reqlen = sizeof(*p)
+ (src ? src->sa_len : 0)
+ (dst ? dst->sa_len : 0);
- tlen += reqlen; /* increment to total length */
- pbuf = realloc(pbuf, tlen);
+ n = realloc(pbuf, tlen + reqlen);
if (pbuf == NULL) {
__ipsec_errcode = EIPSEC_NO_BUFS;
return -1;
}
+ tlen += reqlen;
+ pbuf = n;
p = (struct sadb_x_ipsecrequest *)&pbuf[offset];
p->sadb_x_ipsecrequest_len = reqlen;
p->sadb_x_ipsecrequest_proto = p_protocol;
Home |
Main Index |
Thread Index |
Old Index