[tor-bugs] #34232 [Core Tor/Tor]: Make summarize_protover_flags() handle NULL and empty string the same
Tor Bug Tracker & Wiki
blackhole at torproject.org
Fri May 15 13:26:46 UTC 2020
#34232: Make summarize_protover_flags() handle NULL and empty string the same
------------------------------+--------------------------------------
Reporter: teor | Owner: (none)
Type: defect | Status: new
Priority: Medium | Milestone: Tor: unspecified
Component: Core Tor/Tor | Version:
Severity: Normal | Keywords: technical-debt, protover
Actual Points: | Parent ID:
Points: 0.5 | Reviewer:
Sponsor: |
------------------------------+--------------------------------------
summarize_protover_flags(NULL, NULL) doesn't set protocols_known, but
summarize_protover_flags("", "") does.
While this situation probably won't happen in practice, it could be a
source of subtle bugs.
And we have a general guideline that functions should treat NULL and "" in
similar ways. (Or the difference should be clearly documented.)
So we should ignore "" protovers, the same way we ignore NULL protovers.
(Relays with empty protovers won't end up in the consensus, and clients
can't use them for anything. So this change should have no real impact.)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/34232>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list