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

Re: [tor-bugs] #28077 [Core Tor/Tor]: remove unsafe block from cstr! macro



#28077: remove unsafe block from cstr! macro
--------------------------+------------------------------------
 Reporter:  cyberpunks    |          Owner:  (none)
     Type:  defect        |         Status:  needs_revision
 Priority:  Medium        |      Milestone:
Component:  Core Tor/Tor  |        Version:  Tor: 0.3.4.1-alpha
 Severity:  Normal        |     Resolution:
 Keywords:  rust          |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by cyberpunks):

 Replying to [comment:4 teor]:
 > But I still think we don't want to hide errors by substituting the empty
 string.

 Misuse is extremely unlikely to slip in since this is only used on string
 literals. But yeah, he ideal solution would be statically asserting at
 compile-time that the passed literal has no NUL bytes in it, so the only
 one is the byte being appended.

 But defaulting to an empty string(in a case that is basically impossible
 to get) is the intentional documented behavior of the macro ever since it
 was first merged in #25185. Improving on that seems like a separate
 ticket.

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