[tor-bugs] #2352 [Tor Client]: more size_t_ceiling fun
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Wed Jan 12 19:37:40 UTC 2011
#2352: more size_t_ceiling fun
------------------------+---------------------------------------------------
Reporter: arma | Owner:
Type: defect | Status: needs_review
Priority: normal | Milestone: Tor: 0.2.2.x-final
Component: Tor Client | Version:
Keywords: | Parent:
------------------------+---------------------------------------------------
Comment(by nickm):
Replying to [comment:6 cypherpunks]:
> {{{
> tor_assert(len < INT_MAX && len < SIZE_T_CEILING);
> }}}
> len is ssize_t (signed).
> Hopes no one platform defines those constants as unsigned.
> Except it does Tor, for missed defines:
> {{{
> #ifndef INT32_MAX
> #define INT32_MAX 0x7fffffffu
> }}}
> {{{
> #ifndef SSIZE_T_MAX
> #if (SIZEOF_SIZE_T == 4)
> #define SSIZE_T_MAX INT32_MAX
> }}}
>
> Fix:
> {{{
> tor_assert(len < (ssize_t)INT_MAX && len < (ssize_t)SIZE_T_CEILING);
> }}}
Here I'm going to fix the definition of INT32_MAX: It should be signed.
(fixed in commit 9fcc14224b689dff1be8336feeeb563199694c27.)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2352#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list