Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/e3ec5c329c0c
branches:  trunk
changeset: 822372:e3ec5c329c0c
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Mar 17 10:05:02 2017 +0000

description:
Add missing NULL check

Fix PR kern/52083

diffstat:

 sys/net/rtsock.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 060d060e360e -r e3ec5c329c0c sys/net/rtsock.c
--- a/sys/net/rtsock.c  Fri Mar 17 08:51:44 2017 +0000
+++ b/sys/net/rtsock.c  Fri Mar 17 10:05:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtsock.c,v 1.208 2017/03/14 09:39:28 ozaki-r Exp $     */
+/*     $NetBSD: rtsock.c,v 1.209 2017/03/17 10:05:02 ozaki-r Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.208 2017/03/14 09:39:28 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.209 2017/03/17 10:05:02 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -637,8 +637,8 @@
        }
        if (ifa) {
                struct ifaddr *oifa = rt->rt_ifa;
-               if (oifa != ifa &&
-                   !ifa_is_destroying(ifa) && !if_is_deactivated(new_ifp)) {
+               if (oifa != ifa && !ifa_is_destroying(ifa) &&
+                   new_ifp != NULL && !if_is_deactivated(new_ifp)) {
                        if (oifa && oifa->ifa_rtrequest)
                                oifa->ifa_rtrequest(RTM_DELETE, rt, info);
                        rt_replace_ifa(rt, ifa);



Home | Main Index | Thread Index | Old Index