[tor-bugs] #21716 [Core Tor/Tor]: Avoid recursive call to routerlist_remove_old_routers via router_rebuild_store

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Feb 6 13:38:57 UTC 2018


#21716: Avoid recursive call to routerlist_remove_old_routers via
router_rebuild_store
--------------------------+------------------------------------
 Reporter:  anstein       |          Owner:  (none)
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.3.4.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  easy intro    |  Actual Points:
Parent ID:                |         Points:  0.5
 Reviewer:                |        Sponsor:
--------------------------+------------------------------------

Comment (by aruna1234):

 It's not a typical recursion, where the function calls itself, but is
 surely an issue, as this:

 if (!(flags & RRS_DONT_REMOVE_OLD))
     routerlist_remove_old_routers();
 leads to a call to routerlist_remove_old_routers(), which in turn leads to
 two calls to the calling function.

 Maybe a while loop replacing the if condition would resolve this?

 while(!(flags & RRS_DONT_REMOVE_OLD))...

 make check ran without fail.

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


More information about the tor-bugs mailing list