[tor-bugs] #26284 [Core Tor/Tor]: Out-of-bounds smartlist access in protover_compute_vote()

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jun 8 10:42:56 UTC 2018


#26284: Out-of-bounds smartlist access in protover_compute_vote()
--------------------------+------------------------------------
 Reporter:  rl1987        |          Owner:  rl1987
     Type:  defect        |         Status:  needs_revision
 Priority:  Medium        |      Milestone:  Tor: 0.3.4.x-final
Component:  Core Tor/Tor  |        Version:  Tor: unspecified
 Severity:  Normal        |     Resolution:
 Keywords:  fast-fix      |  Actual Points:
Parent ID:  #26196        |         Points:
 Reviewer:  asn           |        Sponsor:
--------------------------+------------------------------------

Comment (by asn):

 Fixups LGTM.

 Please squash the branch so that it's just one commit.

 Also please consider adding some curly braces in this if clause:
 {{{
 +  if (smartlist_len(list_of_proto_strings) == 0)
 +    return tor_strdup("");
 }}}
 IMO, we should be adding curly braces even in trivial if statements to
 avoid potential Apple `goto fail` issues ;)

 After you do so, feel free to turn it into merge_ready.

 Thanks! :)

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


More information about the tor-bugs mailing list