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

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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs