[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fix integer overflow in svn_auth.h

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-10-25 12:50:10 CEST

Tobias Ringström wrote:

> Justin Erenkrantz wrote:
>
>> So, what to do? Yet, I propose to change it as follows. -- justin
>
>
> Whoups, my mistake. I added that code yesterday. I really intended
> (1<<30) to avoid the sign bit, but I obviously cannot count. I doubt
> that anyone has had time to depend on that bit position yet, so I've
> fixed it in revision 7518. Thanks for spotting this! I think I have
> seen gcc warn about this, but it did not this time... :-(
>
> Actually it would have been enough to say (1U << 31), but I think it's
> still wise to stay away from the sign bit.

No, Greg Hudson is right. Use apr_uint32_t for the bitmask. And please
define the constants as constants, not expressions; e.g.,

    #define SVN_AUTH_SSL_OTHER 0x80000000

Then the compiler won't complain.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 25 12:53:08 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.