cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patch] libcurl 7.12.2-20040917 and CURLOPT_VERBOSE may read free()ed data

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 28 Sep 2004 20:48:37 +0200 (CEST)

On Mon, 27 Sep 2004, Bertrand Demiddelaer wrote:

> Here's a new fix which works for me, and a test program to run with
> valgrind...

This will leave the entry without unlocking it, thus having the inuse counter
increased and never decreased again. It will never get pruned.

I believe a better fix is to make the unlock (unconditionally like it is
currently made in Curl_done()) in the Curl_disconnect() function. We want the
inuse counter to be zero when nothing uses the dns entry anymore.

> The test 506 is now broken, but I suspect it's a false positive against the
> new code (I didn't have time to check it or to modify it).

I think your extra lock calls are fine so we should update 506 once we've
completed this fix.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-09-28