[tor-bugs] #31638 [Core Tor/Tor]: config: Always check for valid function arguments at the start of each function

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Sep 5 01:01:08 UTC 2019


#31638: config: Always check for valid function arguments at the start of each
function
------------------------------+-----------------------------------------
     Reporter:  teor          |      Owner:  nickm
         Type:  task          |     Status:  assigned
     Priority:  Medium        |  Milestone:  Tor: 0.4.2.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  network-team-roadmap-august
Actual Points:                |  Parent ID:  #29211
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+-----------------------------------------
 Some of the new and refactored config functions check if their arguments
 are NULL (or otherwise valid). Others don't.

 We should consistently check for valid arguments at the start of every
 function. If there are any unusual validity conditions, we should explain
 them in a function comment.

 If we skip validation, we should explain why in a comment, where we would
 usually do validation.

 I'm also open to general exceptions. I'm not sure if we have coding
 standards here. But it would be nice to catch as many future bugs as we
 can, as early as we can.

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


More information about the tor-bugs mailing list