Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/npf/npfctl CID 1129614: dereference after null



details:   https://anonhg.NetBSD.org/src/rev/43420c9e762b
branches:  trunk
changeset: 791469:43420c9e762b
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 19 17:01:45 2013 +0000

description:
CID 1129614: dereference after null

diffstat:

 usr.sbin/npf/npfctl/npf_show.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 060159fdf953 -r 43420c9e762b usr.sbin/npf/npfctl/npf_show.c
--- a/usr.sbin/npf/npfctl/npf_show.c    Tue Nov 19 16:58:16 2013 +0000
+++ b/usr.sbin/npf/npfctl/npf_show.c    Tue Nov 19 17:01:45 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_show.c,v 1.5 2013/11/19 00:28:41 rmind Exp $       */
+/*     $NetBSD: npf_show.c,v 1.6 2013/11/19 17:01:45 christos Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: npf_show.c,v 1.5 2013/11/19 00:28:41 rmind Exp $");
+__RCSID("$NetBSD: npf_show.c,v 1.6 2013/11/19 17:01:45 christos Exp $");
 
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -161,6 +161,8 @@
                if (npf_table_getid(tl) == tid)
                        break;
        }
+       if (tl == NULL)
+               errx(EXIT_FAILURE, "table id %u not found", tid);
        easprintf(&p, "%s", npf_table_getname(tl));
        return p;
 }



Home | Main Index | Thread Index | Old Index