svn commit: r216346 - stable/8/sbin/ipfw

Luigi Rizzo rizzo at iet.unipi.it
Fri Dec 10 06:56:35 UTC 2010


thank you for doing these three MFC

cheers
luigi

On Fri, Dec 10, 2010 at 05:15:47AM +0000, Andrey V. Elsukov wrote:
> 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-all mailing list