From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 08:29:14 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03FFE1065673 for ; Mon, 12 Apr 2010 08:29:14 +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 BD17A8FC0C for ; Mon, 12 Apr 2010 08:29:13 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 63C5F730A1; Mon, 12 Apr 2010 10:39:35 +0200 (CEST) Date: Mon, 12 Apr 2010 10:39:35 +0200 From: Luigi Rizzo To: Hizel Ildar Message-ID: <20100412083935.GA86145@onelab2.iet.unipi.it> References: <4BC1790F.1020205@lissyara.su> <20100412100756.1ef3af73@hzwork.vyborg.ru> <4BC2C0D1.9090700@yandex.ru> <20100412111545.0a8a3308@hzwork.vyborg.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100412111545.0a8a3308@hzwork.vyborg.ru> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org Subject: Re: ipfw bug on i386 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 08:29:14 -0000 On Mon, Apr 12, 2010 at 11:15:45AM +0400, Hizel Ildar wrote: > ?? Mon, 12 Apr 2010 10:42:25 +0400 > "Andrey V. Elsukov" ??????????: > > > On 12.04.2010 10:07, Hizel Ildar wrote: > > > Hey! I'm fix this bug :D > > > > > > patch: > > > > > > foo# diff -ruN main.c~ main.c > > > --- main.c~ 2010-03-04 19:54:56.000000000 +0300 > > > +++ main.c 2010-04-12 09:37:21.000000000 +0400 > > > @@ -553,7 +553,7 @@ > > > } > > > > > > while (fgets(buf, BUFSIZ, f)) { /* read commands */ > > > - char linename[10]; > > > + char linename[11]; > > > char *args[2]; > > > > > > lineno++; > > > > Can you test your it with 100k lines? :) > > I think it can be fixed with something similar to: > > > > - sprintf(linename, "Line %d", lineno); > > + snprintf(linename, sizeof(linename), "Line %d", > > lineno); > > > > > and the variable linename will be incorrect information, it is necessary > to increase the linename to 16 at least > > char linename[16] indeed. i just committed something like this, with a larger buffer. thanks for the feedback luigi > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"