[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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 karsten):

 Looks like the problem is that rep_hist_format_desc_stats() returns NULL
 if size == 0.  I wonder if it should instead return a string saying it
 didn't serve a single descriptor, e.g., `"served-descs-stats-end
 2012-05-15 09:18:27 (86400 s) total=0 unique=0 max=0 q3=0 md=0 q1=0
 min=0\n"`.  That's different from not having any statistics for the time
 period.  Btw, the docs also don't say that the function returns NULL if
 size == 0.  So, the better fix would be to fix
 rep_hist_format_desc_stats().  If I prepare a patch, can you test it?

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5891#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs