curl-library
Re: Bug in Curl_fillreadbuffer
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 9 Jun 2008 09:29:22 +0200 (CEST)
Date: Mon, 9 Jun 2008 09:29:22 +0200 (CEST)
On Sun, 8 Jun 2008, Brock Noland wrote:
> http://curl.haxx.se/mail/curlphp-2008-06/0021.html
>
> I seem to have found a bug in Curl_fillreadbuffer.
[...]
> else if((size_t)nread > buffersize)
> /* the read function returned a too large value */
> return CURLE_READ_ERROR;
> If nread is -1, when cast to size_t, its a very large number.
Yes, but why is that a bug in libcurl? In what legitimate use case does the
read function return -1?
It is evem documented to return a 'size_t' which on all modern operation
systems is an unsigned type.
-- / daniel.haxx.seReceived on 2008-06-09