Re: ipfw bug on i386

From: Hizel Ildar <hizel_at_vyborg.ru>
Date: Mon, 12 Apr 2010 11:15:45 +0400
В Mon, 12 Apr 2010 10:42:25 +0400
"Andrey V. Elsukov" <bu7cher_at_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
> > _at__at_ -553,7 +553,7 _at__at_
> >          }
> >
> >          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]
Received on Mon Apr 12 2010 - 05:15:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:02 UTC