cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: A strange problem with NTLM authentication, solved

From: Tor Arntsen <tor_at_spacetec.no>
Date: Mon, 3 Apr 2006 16:03:03 +0200

On Apr 3, 14:52, Daniel Stenberg wrote:
>On Mon, 3 Apr 2006, Michele Bini wrote:
>
>> I'm attaching a patch against curl 7.15.1; I tested it on linux/x86, windows
>> and osx/ppc connecting to the following servers:
>
>Thanks!
>
>But what about this line:
>
>+ ntlm->flags = *(unsigned long *)&buffer[20]; /* ENDIAN */
>
>I couldn't find any code that takes care of this in an endian-specific way.
>Isn't that a problem? I don't see how libcurl on PPC and x86 can possibly
>treat that the same way...

Not only that, but it's not possible to cast an address in a char buffer
to an address of long on RISC CPUs (certainly MIPS, probably SPARC and PPC
too), you'll get a bus error unless the &buffer[20] just happens to be on
a 4-byte boundary in 32-bit mode or 8-byte boundary in 64-bit mode. And
as a char array can start on any byte address this is not guaranteed.

-Tor
Received on 2006-04-03