Module Name: src Committed By: rmind Date: Sun Jul 12 23:54:44 UTC 2015
Modified Files: src/usr.sbin/npf: npf.7 src/usr.sbin/npf/npfctl: npf_var.c Log Message: - npfvar_get_type1: check for NULL first. - Minor fix for the npf(7) man page. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/npf/npf.7 cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npfctl/npf_var.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/npf.7 diff -u src/usr.sbin/npf/npf.7:1.2 src/usr.sbin/npf/npf.7:1.3 --- src/usr.sbin/npf/npf.7:1.2 Sun Aug 10 19:09:43 2014 +++ src/usr.sbin/npf/npf.7 Sun Jul 12 23:54:43 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: npf.7,v 1.2 2014/08/10 19:09:43 rmind Exp $ +.\" $NetBSD: npf.7,v 1.3 2015/07/12 23:54:43 rmind Exp $ .\" .\" Copyright (c) 2009-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 2, 2014 +.Dd July 13, 2015 .Dt NPF 7 .Os .Sh NAME @@ -69,7 +69,7 @@ Traffic normalization (extension). Packet logging (extension). .El .Pp -For a full set features and their description, see the NPF +For a full set of features and their description, see the NPF documentation and other manual pages. .\" ----- .Sh SEE ALSO Index: src/usr.sbin/npf/npfctl/npf_var.c diff -u src/usr.sbin/npf/npfctl/npf_var.c:1.8 src/usr.sbin/npf/npfctl/npf_var.c:1.9 --- src/usr.sbin/npf/npfctl/npf_var.c:1.8 Tue Nov 19 00:28:41 2013 +++ src/usr.sbin/npf/npfctl/npf_var.c Sun Jul 12 23:54:44 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: npf_var.c,v 1.8 2013/11/19 00:28:41 rmind Exp $ */ +/* $NetBSD: npf_var.c,v 1.9 2015/07/12 23:54:44 rmind Exp $ */ /*- * Copyright (c) 2011-2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: npf_var.c,v 1.8 2013/11/19 00:28:41 rmind Exp $"); +__RCSID("$NetBSD: npf_var.c,v 1.9 2015/07/12 23:54:44 rmind Exp $"); #include <stdlib.h> #include <string.h> @@ -239,14 +239,14 @@ npfvar_get_type1(const npfvar_t *vp, siz { npf_element_t *el; + if (vp == NULL) + return -1; + if (level >= var_num) { yyerror("variable loop for '%s'", vp->v_key); return -1; } - if (vp == NULL) - return -1; - if (vp->v_count <= idx) { yyerror("variable '%s' has only %zu elements, requested %zu", vp->v_key, vp->v_count, idx);