[tor-bugs] #21496 [Core Tor/Tor]: Check string passed to extrainfo_parse_entry_from_string

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Feb 18 03:30:20 UTC 2017


#21496: Check string passed to extrainfo_parse_entry_from_string
------------------------------+--------------------------------------------
     Reporter:  teor          |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.2.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  clang scan-build memory-safety
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------------------
 scan-build reports the following out of bounds access, because it doesn't
 know that s is always non-NULL. But we should guard against it being NULL.

 extrainfo_parse_entry_from_string:
 {{{
 +  if (BUG(!s))
 +    return;
    while (end > s+2 && *(end-1) == '\n' && *(end-2) == '\n')
 }}}

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


More information about the tor-bugs mailing list