[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:18:16 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: |
-----------------+----------------------------------------------------------
The helper functions get_uint{16,32,64}() and set_uint{16,32,64}() should
be used instead of "*(uint16_t*)(cp)" etc. to avoid unaligned address
access problems with specific OSes.
There are many cases in the source tree that this doesn't happen.
For example, in the cell_unpack() function we have:
{{{
dest->command = *(uint8_t*)(src+2);
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1943>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list