svn commit: r216346 - stable/8/sbin/ipfw
Andrey V. Elsukov
ae at FreeBSD.org
Fri Dec 10 05:15:48 UTC 2010
Author: ae
Date: Fri Dec 10 05:15:47 2010
New Revision: 216346
URL: http://svn.freebsd.org/changeset/base/216346
Log:
MFC r206494 by luigi:
fix a buffer overflow with large (100k+) number of input lines.
Approved by: re (bz)
Modified:
stable/8/sbin/ipfw/main.c
Directory Properties:
stable/8/sbin/ipfw/ (props changed)
Modified: stable/8/sbin/ipfw/main.c
==============================================================================
--- stable/8/sbin/ipfw/main.c Fri Dec 10 00:53:16 2010 (r216345)
+++ stable/8/sbin/ipfw/main.c Fri Dec 10 05:15:47 2010 (r216346)
@@ -553,11 +553,11 @@ ipfw_readfile(int ac, char *av[])
}
while (fgets(buf, BUFSIZ, f)) { /* read commands */
- char linename[10];
+ char linename[20];
char *args[2];
lineno++;
- sprintf(linename, "Line %d", lineno);
+ snprintf(linename, sizeof(linename), "Line %d", lineno);
setprogname(linename); /* XXX */
args[0] = progname;
args[1] = buf;
More information about the svn-src-stable
mailing list