cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cURL bug -- Segmentation Fault when timeout is 1 second

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 4 Feb 2009 19:38:17 +0100 (CET)

On Wed, 4 Feb 2009, Daniel Marschall wrote:

PLEASE stop the top-posting as requested in the etiquette guidelines for this
mailing list: http://curl.haxx.se/mail/etiquette.html

> buffer = (char*)realloc(buffer, size * nmemb); // Extend the buffer

This doesn't extend the buffer, it resizes it to the size of the most recent
chunk.

> // Append the data to the buffer
> strcat(buffer, data);

This assumes that the incoming data is zero-terminated, which is a bad
assumption.

-- 
  / daniel.haxx.se
Received on 2009-02-04