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

[or-cvs] Backport circuit_about_to_close_connection() fix. This mig...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv5561/src/or

Modified Files:
      Tag: tor-0_1_0-patches
	circuituse.c 
Log Message:
Backport circuit_about_to_close_connection() fix.  This might have caused memory connection if we somehow accessed a p_conn or n_conn from a circuit after the connection  was closed, and before the corresponding circuit was freed.  I am not convinced this was actually corrupting anything, but who knows.

Index: circuituse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.72
retrieving revision 1.72.2.1
diff -u -d -r1.72 -r1.72.2.1
--- circuituse.c	15 May 2005 05:00:24 -0000	1.72
+++ circuituse.c	1 Dec 2005 01:44:30 -0000	1.72.2.1
@@ -486,10 +486,10 @@
       while ((circ = circuit_get_by_conn(conn))) {
         if (circ->n_conn == conn)
           /* it's closing in front of us */
-          circuit_set_circid_orconn(circ, 0, NULL, P_CONN_CHANGED);
+          circuit_set_circid_orconn(circ, 0, NULL, N_CONN_CHANGED);
         if (circ->p_conn == conn)
           /* it's closing behind us */
-          circuit_set_circid_orconn(circ, 0, NULL, N_CONN_CHANGED);
+          circuit_set_circid_orconn(circ, 0, NULL, P_CONN_CHANGED);
         circuit_mark_for_close(circ);
       }
       return;