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

Re: [tor-bugs] #4229 [Tor Client]: smartlist_len returns a (signed) int



#4229: smartlist_len returns a (signed) int
------------------------+---------------------------------------------------
 Reporter:  rransom     |          Owner:                    
     Type:  defect      |         Status:  new               
 Priority:  major       |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by mansour):

 Replying to [comment:2 rransom]:
 > It's also not quite clear what we want to do for lengths in general --
 do we sometimes use negative return values to indicate failure of a
 function that would normally return a length?  At the very least, we need
 safe (overflow-checking) unsigned-to-signed and signed-to-unsigned cast
 macros.

 One approach is to pass a pointer to where "returned" lengths will be
 stored as an argument, and use the return values to indicate errors only.

 See attached for an example.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4229#comment:3>
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