ipfw bug on i386
Andrey V. Elsukov
bu7cher at yandex.ru
Mon Apr 12 06:42:28 UTC 2010
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);
--
WBR, Andrey V. Elsukov
More information about the freebsd-current
mailing list