From dan@obluda.cz  Thu Jan 21 21:32:43 1999
Received: from www.fio.cz (www.fio.cz [194.212.227.46])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA19752
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 21 Jan 1999 21:32:40 -0800 (PST)
          (envelope-from dan@obluda.cz)
Received: (from root@localhost)
	by fio.cz (8.9.2/8.9.0) id DAA02648;
	Fri, 22 Jan 1999 03:54:56 +0100 (CET)
Message-Id: <199901220254.DAA02648@fio.cz>
Date: Fri, 22 Jan 1999 03:54:56 +0100 (CET)
From: dan@obluda.cz
Reply-To: dan@obluda.cz
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] IPFW command-line parsing error
X-Send-Pr-Version: 3.2

>Number:         9613
>Category:       bin
>Synopsis:       [PATCH] IPFW command-line parsing error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 21 21:40:01 PST 1999
>Closed-Date:    Fri Jun 4 05:43:28 PDT 1999
>Last-Modified:  Fri Jun  4 05:49:09 PDT 1999
>Originator:     Dan Lukes
>Release:        FreeBSD 2.2.8-RELEASE i386
>Organization:
Obludarium
>Environment:

	no special environment settings, standard instalation
        $Id: ipfw.c,v 1.34.2.20 1998/10/12 17:29:15 luigi Exp $

>Description:

/sbin/ipfw/ipfw.c:

	when
	ipfw [-aftN] list [number ...]	
	is called, but 'number' parameter is not number, the ipfw wrote bad
error message and (sometime) ABEND.
	It is caused by missing dereference of printed parameter. 
	The warn routine should be replaced by warnx, because the value of
errno is set to nothing relevant in this context.

>How-To-Repeat:

	ipfw l -a  (for example)

>Fix:
	
--- ipfw.c.ORIG Mon Oct 12 19:29:15 1998
+++ ipfw.c      Thu Jan 21 21:09:03 1999
@@ -493,7 +493,7 @@
                        rulenum = strtoul(*av++, &endptr, 10);
                        if (*endptr) {
                                exitval = 1;
-                               warn("invalid rule number: %s", av - 1);
+                               warnx("invalid rule number: %s", *(av - 1));
                                continue;
                        }
                        seen = 0;


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Fri Jun 4 05:43:28 PDT 1999 
State-Changed-Why:  
Fixed in revs 1.52 and 1.65 of ipfw.c. 
Upgrade to 3.2-STABLE if you're still running 2.2.8. 
>Unformatted:
