[tor-bugs] #6877 [Tor]: Finally replace all char[] buffers with uint8_t[] buffers

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jan 12 16:52:39 UTC 2016


#6877: Finally replace all char[] buffers with uint8_t[] buffers
------------------------+------------------------------
 Reporter:  nickm       |          Owner:
     Type:  defect      |         Status:  new
 Priority:  High        |      Milestone:  Tor: 0.2.???
Component:  Tor         |        Version:
 Severity:  Normal      |     Resolution:
 Keywords:  tor-client  |  Actual Points:
Parent ID:              |         Points:
  Sponsor:              |
------------------------+------------------------------

Comment (by cypherpunks):

 uint8_t is a dangerous choice. It is not guaranteed by the standard to be
 the same as unsigned char and can be an unrelated type.

 If it is an unrelated type, dereferencing an uint8_t* pointer that was
 created from a char* is undefined behavior (violates strict aliasing).
 There are a lot of casts between char* and uint8_t* in the Tor code, so
 this is likely happening.

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


More information about the tor-bugs mailing list