From owner-svn-src-all@FreeBSD.ORG Fri Dec 10 06:56:35 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599C5106564A; Fri, 10 Dec 2010 06:56:35 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 194188FC08; Fri, 10 Dec 2010 06:56:34 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 9E5F073098; Fri, 10 Dec 2010 08:10:09 +0100 (CET) Date: Fri, 10 Dec 2010 08:10:09 +0100 From: Luigi Rizzo To: "Andrey V. Elsukov" Message-ID: <20101210071009.GA59553@onelab2.iet.unipi.it> References: <201012100515.oBA5FlLa062151@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012100515.oBA5FlLa062151@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r216346 - stable/8/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 06:56:35 -0000 thank you for doing these three MFC cheers luigi On Fri, Dec 10, 2010 at 05:15:47AM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Fri Dec 10 05:15:47 2010 > New Revision: 216346 > URL: http://svn.freebsd.org/changeset/base/216346 > > Log: > MFC r206494 by luigi: > fix a buffer overflow with large (100k+) number of input lines. > > Approved by: re (bz) > > Modified: > stable/8/sbin/ipfw/main.c > Directory Properties: > stable/8/sbin/ipfw/ (props changed) > > Modified: stable/8/sbin/ipfw/main.c > ============================================================================== > --- stable/8/sbin/ipfw/main.c Fri Dec 10 00:53:16 2010 (r216345) > +++ stable/8/sbin/ipfw/main.c Fri Dec 10 05:15:47 2010 (r216346) > @@ -553,11 +553,11 @@ ipfw_readfile(int ac, char *av[]) > } > > while (fgets(buf, BUFSIZ, f)) { /* read commands */ > - char linename[10]; > + char linename[20]; > char *args[2]; > > lineno++; > - sprintf(linename, "Line %d", lineno); > + snprintf(linename, sizeof(linename), "Line %d", lineno); > setprogname(linename); /* XXX */ > args[0] = progname; > args[1] = buf;