[tor-bugs] #3035 [Tor Client]: fix a few clang-static analyzer complaints in 0.2.2

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Fri Apr 29 15:14:22 UTC 2011


#3035: fix a few clang-static analyzer complaints in 0.2.2
------------------------+---------------------------------------------------
 Reporter:  Sebastian   |          Owner:                    
     Type:  defect      |         Status:  needs_review      
 Priority:  normal      |      Milestone:  Tor: 0.2.2.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by Sebastian):

 Replying to [comment:3 arma]:
 > {{{
 >  #define CONN_LOG_PROTECT(conn, stmt)
 \
 >    STMT_BEGIN
 \
 > -    int _log_conn_is_control = (conn && conn->type ==
 CONN_TYPE_CONTROL); \
 > +    int _log_conn_is_control;
 \
 > +    tor_assert(conn);
 \
 > +    _log_conn_is_control = (conn->type == CONN_TYPE_CONTROL);
 \
 > }}}
 >
 > What if tor_assert triggers, causing us to do a log to the controller at
 the same time, which would want to disable logging, ...

 I don't see the issue here, maybe I am silly? We haven't yet stopped
 logging to the controller, so the assert will get logged (we don't disable
 logging to the controller until after the assert, and tor_assert doesn't
 disable control logging) and die.

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


More information about the tor-bugs mailing list