Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 CID 1396598, CID 1396634: Fix null pointer dere...



details:   https://anonhg.NetBSD.org/src/rev/62d444f1e699
branches:  trunk
changeset: 819382:62d444f1e699
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Dec 02 00:19:54 2016 +0000

description:
CID 1396598, CID 1396634: Fix null pointer dereferences

diffstat:

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

diffs (30 lines):

diff -r a17754314701 -r 62d444f1e699 sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c    Thu Dec 01 20:23:10 2016 +0000
+++ b/sys/netinet6/in6_src.c    Fri Dec 02 00:19:54 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_src.c,v 1.74 2016/11/10 04:13:53 ozaki-r Exp $     */
+/*     $NetBSD: in6_src.c,v 1.75 2016/12/02 00:19:54 ozaki-r Exp $     */
 /*     $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $     */
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.74 2016/11/10 04:13:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.75 2016/12/02 00:19:54 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -670,9 +670,9 @@
         *  our own addresses.)
         */
        if (opts && opts->ip6po_pktinfo && opts->ip6po_pktinfo->ipi6_ifindex) {
-               if (!(rt->rt_ifp->if_flags & IFF_LOOPBACK) &&
+               if (rt != NULL && !(rt->rt_ifp->if_flags & IFF_LOOPBACK) &&
                    rt->rt_ifp->if_index != opts->ip6po_pktinfo->ipi6_ifindex) {
-                       if (rt != NULL && count_discard)
+                       if (count_discard)
                                in6_ifstat_inc(rt->rt_ifp, ifs6_out_discard);
                        error = EHOSTUNREACH;
                        rt = NULL;



Home | Main Index | Thread Index | Old Index