Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2010 10:39:35 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Hizel Ildar <hizel@vyborg.ru>
Cc:        freebsd-current@freebsd.org
Subject:   Re: ipfw bug on i386
Message-ID:  <20100412083935.GA86145@onelab2.iet.unipi.it>
In-Reply-To: <20100412111545.0a8a3308@hzwork.vyborg.ru>
References:  <4BC1790F.1020205@lissyara.su> <20100412100756.1ef3af73@hzwork.vyborg.ru> <4BC2C0D1.9090700@yandex.ru> <20100412111545.0a8a3308@hzwork.vyborg.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 12, 2010 at 11:15:45AM +0400, Hizel Ildar wrote:
> ?? Mon, 12 Apr 2010 10:42:25 +0400
> "Andrey V. Elsukov" <bu7cher@yandex.ru> ??????????:
> 
> > 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100412083935.GA86145>