Module Name:    src
Committed By:   christos
Date:           Tue Nov 19 17:01:45 UTC 2013

Modified Files:
        src/usr.sbin/npf/npfctl: npf_show.c

Log Message:
CID 1129614: dereference after null


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/npf/npfctl/npf_show.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_show.c
diff -u src/usr.sbin/npf/npfctl/npf_show.c:1.5 src/usr.sbin/npf/npfctl/npf_show.c:1.6
--- src/usr.sbin/npf/npfctl/npf_show.c:1.5	Mon Nov 18 19:28:41 2013
+++ src/usr.sbin/npf/npfctl/npf_show.c	Tue Nov 19 12:01:45 2013
@@ -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 @@ print_table(npf_conf_info_t *ctx, const 
 		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;
 }

Reply via email to