cURL / Mailing Lists / curl-users / Single Mail

curl-users

Another redirection bug (patch)

From: Ingo Wilken <iw_at_WWW.Ecce-Terram.DE>
Date: Thu, 10 May 2001 21:56:13 +0200 (MET DST)

Another fix for relocation handling in Transfer(). newurl is free()'d
later in this function if non-NULL, causing data->url to point to
unallocated memory.

This patch fixes the problem:

---cut here---
diff -cwr curl-7.7.3-1/lib/transfer.c curl-7.7.3-2/lib/transfer.c
*** curl-7.7.3-1/lib/transfer.c Thu May 3 12:45:39 2001
--- curl-7.7.3-2/lib/transfer.c Thu May 10 21:45:21 2001
***************
*** 904,909 ****
--- 904,910 ----
        
          /* TBD: set the URL with curl_setopt() */
          data->url = newurl;
+ newurl = NULL; /* don't free! */
  
          data->bits.urlstringalloc = TRUE; /* the URL is allocated */
  
---cut here---

Regards,
Ingo

-- 
ECCE TERRAM Internet Services GmbH          Ingo Wilken
Edewechter Landstr. 42                      delta_at_ecce-terram.de
26131 Oldenburg                             ++49 (0)441/500-12-0
Received on 2001-05-10