Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Add missing NULL check



details:   https://anonhg.NetBSD.org/src/rev/bf17b2dff68d
branches:  trunk
changeset: 826912:bf17b2dff68d
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Oct 05 03:42:14 2017 +0000

description:
Add missing NULL check

PR kern/52554

diffstat:

 sys/netinet6/nd6.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 24ba0c56979c -r bf17b2dff68d sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c        Thu Oct 05 03:24:40 2017 +0000
+++ b/sys/netinet6/nd6.c        Thu Oct 05 03:42:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6.c,v 1.235 2017/06/22 09:24:02 ozaki-r Exp $        */
+/*     $NetBSD: nd6.c,v 1.236 2017/10/05 03:42:14 ozaki-r Exp $        */
 /*     $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $   */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.235 2017/06/22 09:24:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.236 2017/10/05 03:42:14 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2321,6 +2321,11 @@
                created = true;
        }
 
+       if (ln == NULL) {
+               m_freem(m);
+               return ENETDOWN; /* better error? */
+       }
+
        LLE_WLOCK_ASSERT(ln);
 
        /* We don't have to do link-layer address resolution on a p2p link. */



Home | Main Index | Thread Index | Old Index