Re: Security: gsu



Chris Evans <chris@ferret.lmh.ox.ac.uk> writes:

> On 25 Feb 1999, Martin Baulig wrote:
> 
> > Am I correct that this
> > 
> > 	read(user_supplied_data, password, -1)
> > 
> > equals to
> > 
> > 	read(user_supplied_data, password, MAXINT-1)
> 
> That's my guess.

Actually tried it out with a short test doing a

	int ret, len = -1;
	char buffer [BUFSIZ];

	ret = read(0, buffer, len);
	fprintf (stderr, "Read %d bytes from standard input.\n", ret);

and there seems to be no limit on how many bytes it reads.

> > I will change this to be `size_t len' in CVS - is this the correct fix,
> > a `size_t' should always be unsigned ?
> 
> I would just use "unsigned int"

Just changed it, thanks. This will also fix all problems with broken
libc's defining a `size_t' to be a `signed int'.

-- 
Martin Baulig - martin@home-of-linux.org - http://www.home-of-linux.org



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]