cURL / Mailing Lists / curl-library / Single Mail

curl-library

alarm()-based DNS timeout bug?

From: Thomas Lopatic <lopatic_at_yahoo-inc.com>
Date: Sun, 21 Mar 2010 11:36:08 -0700

Hey there,

I am currently battling a problem with heap corruption where the string
"name lookup timed out" appears at a seemingly random location on my
heap and thus corrupts data.

Looking at the code of Curl_resolv_timeout() in hostip.c, I think that
in case of a timeout, the signal handler for SIGALRM never gets removed.
I think that in my case it gets executed at some point later on when
execution has long left Curl_resolv_timeout() or even the cURL library.

The code that is jumped to with siglongjmp() simply sets the error
message to "name lookup timed out" and then returns with
CURLRESOLV_ERROR. I guess that instead of simply returning without
cleaning up, the code should have a goto that jumps to the spot right
after the call to Curl_resolv().

Or am I missing something?

Thomas
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-21