Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/npf - npfvar_get_type1: check for NULL first.



details:   https://anonhg.NetBSD.org/src/rev/81ad863e8f64
branches:  trunk
changeset: 339327:81ad863e8f64
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Jul 12 23:54:43 2015 +0000

description:
- npfvar_get_type1: check for NULL first.
- Minor fix for the npf(7) man page.

diffstat:

 usr.sbin/npf/npf.7            |   6 +++---
 usr.sbin/npf/npfctl/npf_var.c |  10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (63 lines):

diff -r 1ff11cf6f0e0 -r 81ad863e8f64 usr.sbin/npf/npf.7
--- a/usr.sbin/npf/npf.7        Sun Jul 12 23:51:53 2015 +0000
+++ b/usr.sbin/npf/npf.7        Sun Jul 12 23:54:43 2015 +0000
@@ -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 @@
 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
diff -r 1ff11cf6f0e0 -r 81ad863e8f64 usr.sbin/npf/npfctl/npf_var.c
--- a/usr.sbin/npf/npfctl/npf_var.c     Sun Jul 12 23:51:53 2015 +0000
+++ b/usr.sbin/npf/npfctl/npf_var.c     Sun Jul 12 23:54:43 2015 +0000
@@ -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 @@
 {
        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);



Home | Main Index | Thread Index | Old Index