[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #2352 [Tor Client]: more size_t_ceiling fun



#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 cypherpunks):

 Replying to [comment:11 nickm]:
 > Replying to [comment:7 cypherpunks]:
 > > Another thing:
 > > {{{
 > > (int)len
 > > }}}
 > > sszite_t truncates to small int for 64bit vs 32 bit.
 > > Is it safe for non 2's complement 64bit platform (lets assume it
 exist)?
 >
 > I'm not sure, but Tor requires two's complement arithmetic.  We check
 for it in autoconf, and fail to build with an error in torint.h if
 arithmetic is not two's complement.

 So while limit of positive numbers (object size) guranteed less than
 INT_MAX and negative the only -1, I guess it's a safe truncation.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2352#comment:12>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs