cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: [PATCH] segfault when explicitly setting Host header and using CURLOPT_FOLLOWLOCATION

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 23 Apr 2009 23:52:18 +0200 (CEST)

On Wed, 22 Apr 2009, John Whaley wrote:

> We're running into a segfault when setting an explicit "Host:" header with
> CURLOPT_HTTPHEADER and CURLOPT_FOLLOWLOCATION is set to 1. The bug occurs
> when the server returns a redirect and curl is trying to decide whether to
> keep track of the original host name for cookies.
>
> The line of code that crashes is in Curl_http(). It is trying to
> string-compare data->state.first_host, unfortunately data->state.first_host
> is null at that point because this_is_a_follow is true at the time we called
> Curl_http_connect()

Thanks for your work and patch. I'm just not sure yet your suggested fix is
the best possible one:

... if this_is_a_follow is true, why isn't first_host already set from the
previous request that this follows from?

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

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET