[tor-bugs] #5891 [Tor Directory Authority]: rep_hist_desc_stats_write() segfaults on empty stats

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue May 15 10:58:31 UTC 2012


#5891: rep_hist_desc_stats_write() segfaults on empty stats
-------------------------------------+--------------------------------------
 Reporter:  ln5                      |          Owner:                    
     Type:  defect                   |         Status:  needs_review      
 Priority:  normal                   |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Directory Authority  |        Version:                    
 Keywords:                           |         Parent:                    
   Points:                           |   Actualpoints:                    
-------------------------------------+--------------------------------------

Comment(by ln5):

 Replying to [comment:4 karsten]:
 > Replying to [comment:3 ln5]:
 > > That's a good fix but I think we need this change too since
 > > rep_hist_format_desc_stats() still can return NULL.
 >
 > Only if we're not collecting stats, and we're checking that case in
 rep_hist_desc_stats_write() before calling rep_hist_format_desc_stats().

 Then you don't mind me adding this assert in rep_hist_desc_stats_write()?

   str = rep_hist_format_desc_stats(now);
   tor_assert(str != NULL);


 > Please see branch task-5891 in my public repo.  I stole your changes
 file.  Please tweak as needed.

 Tested.  Works fine.  Thanks.

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


More information about the tor-bugs mailing list