Author: ae
Date: Fri Dec 10 05:16:25 2010
New Revision: 216347
URL: http://svn.freebsd.org/changeset/base/216347

Log:
  MFC r206494 by luigi:
    fix a buffer overflow with large (100k+) number of input lines.
  
  Approved by:  re (bz)

Modified:
  stable/7/sbin/ipfw/main.c
Directory Properties:
  stable/7/sbin/ipfw/   (props changed)

Modified: stable/7/sbin/ipfw/main.c
==============================================================================
--- stable/7/sbin/ipfw/main.c   Fri Dec 10 05:15:47 2010        (r216346)
+++ stable/7/sbin/ipfw/main.c   Fri Dec 10 05:16:25 2010        (r216347)
@@ -491,11 +491,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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to