cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1766320 ] Some LONG options using va_arg with int

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 02 Aug 2007 13:11:52 -0700

Bugs item #1766320, was opened at 2007-08-02 18:39
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1766320&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: portability problem
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Scott Cantor (scantor)
Assigned to: Daniel Stenberg (bagder)
Summary: Some LONG options using va_arg with int

Initial Comment:
I noticed a possible 64-bit bug in libcurl in some of the option setting code where it calls va_arg with "int" as the type of the parameter to pull off the stack. See examples like CURLOPT_DNS_CACHE_TIMEOUT and, CURLOPT_DNS_USE_GLOBAL_CACHE.

This probably works fine until you hit a 64-bit platform where sizeof(long) != sizeof(int). The libcurl docs say that all the "integral" options that aren't large offsets take a long parameter, so if I pass in a long, the code really needs to read a long off the stack, not an int.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2007-08-02 22:11

Message:
Logged In: YES
user_id=1110
Originator: NO

Thanks! Funny how nobody has found this until now, but I guess on many
64bit platforms this accidentally works anyway...

And those are the only options I could see that did this.

Fix committed to CVS just now.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1766320&group_id=976
Received on 2007-08-02

These mail archives are generated by hypermail.

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

File upload with ASP.NET