Subject: Re: gzip buffer overflow found
To: enami tsugutomo <enami@sm.sony.co.jp>
From: Johan Danielsson <joda@pdc.kth.se>
List: current-users
Date: 01/19/2001 17:02:45
enami tsugutomo <enami@sm.sony.co.jp> writes:

> > -            strcpy(z_suffix, optarg);
> > +	    if (z_len > sizeof(z_suffix)-1) {
> > +		fprintf(stderr, "%s: -S suffix too long\n", progname);
> > +		usage();
> > +		do_exit(ERROR);
> > +	    }
> > +            strlcpy(z_suffix, optarg, sizeof(z_suffix));
> 
> Probably it is better to use the same way to detect overflow written
> in man page, isn't it?

Do you have to copy this string at all?

/Johan