cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt() typechecker, try2

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 1 Mar 2008 01:31:46 +0100 (CET)

On Thu, 28 Feb 2008, Jamie Lokier wrote:

> If the argument is fetched in curl_easy_setopt using `va_arg(ap,long)', then
> the code may be actually buggy on 64-bit architectures.
>
> The caller may pass a 32-bit value on the stack, and the callee parse a
> 64-bit value from the stack, so 32 bits of the value seen in the callee can
> be garbage. In this case, if you passed FALSE, the callee might interpret
> it as TRUE instead. Not what you want, a real bug.

Yes, and it is in fact a bit curious that this hasn't bitten us more. Why is
that? Do 64bit archs typically pass on 64bit values on the stack?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-01