cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Missing NULL strdup() check in multi.c:1327

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 21 Aug 2009 09:35:34 +0200 (CEST)

On Wed, 19 Aug 2009, Andre Guibert de Bruet wrote:

> There appears to be a missing NULL-allocation check in multi_runsingle() for
> the newurl parameter that is passed to Curl_retry_request() (Where the
> allocation is actually performed). Presently, this NULL pointer ends up
> being passed to sscanf() in is_absolute_url(), through the Curl_follow()
> call.
>
> The attached patch addresses the issue. Could it be committed upon review?

Ah yes, thanks.

I think the patch was a bit too simple and bailed out a little too much upon
that error. I took this somewhat further and poked the Curl_retry_request()
function to properly return an error code instead and then the change ends up
somewhat larger. See my attached patch. Oh, and also the code in CVS changed
a bit with johansen's pipelining fixes so this probably won't apply to
anything that isn't pretty much CVS HEAD

Comments anyone?

-- 
  / daniel.haxx.se

Received on 2009-08-21