From vd@datamax.bg  Sun May  4 08:17:12 2003
Return-Path: <vd@datamax.bg>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9B94537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 May 2003 08:17:12 -0700 (PDT)
Received: from gw-bj2.datamax.bg (datamax.wl.bitex.com [195.34.115.67])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B493443FBD
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 May 2003 08:17:11 -0700 (PDT)
	(envelope-from vd@datamax.bg)
Received: from sinanica.lg2a.datamax (sinanica.lg2a.datamax [192.168.10.1])
	by gw-bj2.datamax.bg (Postfix) with QMQP id B1E0387C7
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 May 2003 18:17:09 +0300 (EEST)
Received: (nullmailer pid 40908 invoked by uid 1001);
	Sun, 04 May 2003 15:17:22 -0000
Message-Id: <1052061442.037828.40907.nullmailer@sinanica.lg2a.datamax>
Date: Sun, 04 May 2003 18:17:22 +0300
From: Vasil@sinanica.lg2a.datamax, Dimov@sinanica.lg2a.datamax
Reply-To: vd@datamax.bg
To: FreeBSD-gnats-submit@freebsd.org
Subject: ipfw2.c typos
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         51750
>Category:       bin
>Synopsis:       ipfw2.c typos
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    maxim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 04 08:20:11 PDT 2003
>Closed-Date:    Tue Jun 24 00:24:19 PDT 2003
>Last-Modified:  Tue Jun 24 00:24:19 PDT 2003
>Originator:     Vasil Dimov
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
DataMax
>Environment:
System: FreeBSD sinanica.lg2a.datamax 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Wed Apr 30 17:25:36 EEST 2003 root@sinanica.lg2a.datamax:/usr/src/sys/i386/compile/SINANICA i386

>Description:
When outputting errors, in some cases ipfw tries to print av instead of *av, which causes 4 (sizeof(char *)) "random" bytes to be printed. Does not crash, because av ends with '\0'.

After this fix, "WARNS?=0" in the Makefile is no longer needed.

>How-To-Repeat:
ipfw add 100 allow ip from any to any proto foo
ipfw add allow proto boo

>Fix:
cd /usr/src/sbin/ipfw
cat /tmp/ipfw2.c.patch |patch
make && make install
>Release-Note:
>Audit-Trail:

From: Vasil Dimov <vd@datamax.bg>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/51750: ipfw2.c typos
Date: Mon, 5 May 2003 10:55:36 +0300

 --SLDf9lqlvOQaIe6s
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 
 --SLDf9lqlvOQaIe6s
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="ipfw2.c.patch"
 
 --- ipfw2.c.orig	Sat Mar 15 03:12:59 2003
 +++ ipfw2.c	Sun May  4 18:12:44 2003
 @@ -2782,7 +2782,7 @@
  			cmd = next_cmd(cmd);
  		}
  	} else if (first_cmd != cmd) {
 -		errx(EX_DATAERR, "invalid protocol ``%s''", av);
 +		errx(EX_DATAERR, "invalid protocol ``%s''", *av);
  	} else
  		goto read_options;
      OR_BLOCK(get_proto);
 @@ -3115,7 +3115,7 @@
  				proto = cmd->arg1;
  				ac--; av++;
  			} else
 -				errx(EX_DATAERR, "invalid protocol ``%s''", av);
 +				errx(EX_DATAERR, "invalid protocol ``%s''", *av);
  			break;
  
  		case TOK_SRCIP:
 @@ -3162,7 +3162,7 @@
  		case TOK_MACTYPE:
  			NEED1("missing mac type");
  			if (!add_mactype(cmd, ac, *av))
 -				errx(EX_DATAERR, "invalid mac type %s", av);
 +				errx(EX_DATAERR, "invalid mac type %s", *av);
  			ac--; av++;
  			break;
  
 
 --SLDf9lqlvOQaIe6s--
Responsible-Changed-From-To: freebsd-bugs->ipfw 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue May 6 13:48:16 PDT 2003 
Responsible-Changed-Why:  
Over to maintainer group. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51750 
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Mon Jun 16 02:45:02 PDT 2003 
State-Changed-Why:  
Fixed in -CURRENT, thanks! 


Responsible-Changed-From-To: ipfw->maxim 
Responsible-Changed-By: maxim 
Responsible-Changed-When: Mon Jun 16 02:45:02 PDT 2003 
Responsible-Changed-Why:  
MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51750 
State-Changed-From-To: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Tue Jun 24 00:23:53 PDT 2003 
State-Changed-Why:  
Fixed in -STABLE too. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51750 
>Unformatted:
