From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 07:15:47 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 DCD461065674 for ; Mon, 12 Apr 2010 07:15:47 +0000 (UTC) (envelope-from hizel@vyborg.ru) Received: from mail.vyborg.ru (mail.vyborg.ru [195.177.105.12]) by mx1.freebsd.org (Postfix) with ESMTP id 631B48FC22 for ; Mon, 12 Apr 2010 07:15:46 +0000 (UTC) Received: from hzwork.vyborg.ru (o.vyborg.ru [195.177.104.22]) by mail.vyborg.ru (8.14.3/8.14.3) with ESMTP id o3C7H8Bl069495 for ; Mon, 12 Apr 2010 11:17:09 +0400 (MSD) (envelope-from hizel@vyborg.ru) Date: Mon, 12 Apr 2010 11:15:45 +0400 From: Hizel Ildar To: freebsd-current@freebsd.org Message-ID: <20100412111545.0a8a3308@hzwork.vyborg.ru> In-Reply-To: <4BC2C0D1.9090700@yandex.ru> References: <4BC1790F.1020205@lissyara.su> <20100412100756.1ef3af73@hzwork.vyborg.ru> <4BC2C0D1.9090700@yandex.ru> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.20.0; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 07:15:47 -0000 =D0=92 Mon, 12 Apr 2010 10:42:25 +0400 "Andrey V. Elsukov" =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > 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++; >=20 > Can you test your it with 100k lines? :) > I think it can be fixed with something similar to: >=20 > - sprintf(linename, "Line %d", lineno); > + snprintf(linename, sizeof(linename), "Line %d", > lineno); >=20 and the variable linename will be incorrect information, it is necessary to increase the linename to 16 at least char linename[16]