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

Re: [tor-bugs] #5909 [Tor Client]: wcstombs() doesn't guarantee NUL-termination (format_win32_error())



#5909: wcstombs() doesn't guarantee NUL-termination (format_win32_error())
------------------------+---------------------------------------------------
 Reporter:  asn         |          Owner:                    
     Type:  defect      |         Status:  needs_review      
 Priority:  normal      |      Milestone:  Tor: 0.2.2.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
Changes (by nickm):

  * status:  new => needs_review
  * milestone:  Tor: 0.2.3.x-final => Tor: 0.2.2.x-final


Comment:

 I'm pretty sure that we didn't build with -DUNICODE, and as such the only
 wcstombs should be the one in eventdns.c.  Sebastian is too.

 Forcing the output to be NUL-terminated should be simple, though I'm
 pretty surprised if we truly are getting an error message of > 512 wide
 characters.

 Nevertheless, wrong code is wrong code. Added branch "bug5909_022" to
 resolve this by making buffers as big as needed, and by manually nul-
 terminating everything in case my buffer logic turns out to be wrong.

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