[tor-bugs] #1943 [Tor Relay]: Helper functions {get, set}_uint{16, 32, 64}() are not used

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue Sep 14 19:22:26 UTC 2010


#1943: Helper functions {get,set}_uint{16,32,64}() are not used
-----------------+----------------------------------------------------------
 Reporter:  asn  |        Type:  defect   
   Status:  new  |    Priority:  normal   
Milestone:       |   Component:  Tor Relay
  Version:       |    Keywords:           
   Parent:       |  
-----------------+----------------------------------------------------------

Comment(by nickm):

 well, *(uint8_t*)(ptr) is safe: a one-byte read or write is always
 aligned.

 grep '*(uint[136]' src/*/*.c is a good way to look for cases, though not
 all are problematic.  All the ones that touch character buffers should get
 fixed, even if they wind up being aligned-by-accident.  The ones where the
 memory is aligned-on-purpose but cast to void* so we can pass it to a
 generic function don't need fixing.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1943#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list