Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netipsec CID 1220167: NULL Deref
details: https://anonhg.NetBSD.org/src/rev/a436370a414d
branches: trunk
changeset: 329716:a436370a414d
user: christos <christos%NetBSD.org@localhost>
date: Thu Jun 05 17:17:26 2014 +0000
description:
CID 1220167: NULL Deref
diffstat:
sys/netipsec/keysock.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (40 lines):
diff -r 9e34c521782d -r a436370a414d sys/netipsec/keysock.c
--- a/sys/netipsec/keysock.c Thu Jun 05 17:11:54 2014 +0000
+++ b/sys/netipsec/keysock.c Thu Jun 05 17:17:26 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: keysock.c,v 1.26 2014/05/21 20:46:29 rmind Exp $ */
+/* $NetBSD: keysock.c,v 1.27 2014/06/05 17:17:26 christos Exp $ */
/* $FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $ */
/* $KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $ */
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.26 2014/05/21 20:46:29 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.27 2014/06/05 17:17:26 christos Exp $");
#include "opt_ipsec.h"
@@ -243,17 +243,19 @@
tlen = len;
m = mprev = NULL;
while (tlen > 0) {
+ int mlen;
if (tlen == len) {
MGETHDR(n, M_DONTWAIT, MT_DATA);
- n->m_len = MHLEN;
+ mlen = MHLEN;
} else {
MGET(n, M_DONTWAIT, MT_DATA);
- n->m_len = MLEN;
+ mlen = MLEN;
}
if (!n) {
PFKEY_STATINC(PFKEY_STAT_IN_NOMEM);
return ENOBUFS;
}
+ n->m_len = mlen;
if (tlen >= MCLBYTES) { /*XXX better threshold? */
MCLGET(n, M_DONTWAIT);
if ((n->m_flags & M_EXT) == 0) {
Home |
Main Index |
Thread Index |
Old Index