[or-cvs] bugfix: don"t segfault if there"s no valid circuit open

Roger Dingledine arma at seul.org
Sat Apr 19 00:24:20 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home/arma/work/onion/cvs/src/or

Modified Files:
	connection_ap.c 
Log Message:
bugfix: don't segfault if there's no valid circuit open


Index: connection_ap.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_ap.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- connection_ap.c	17 Apr 2003 17:10:40 -0000	1.37
+++ connection_ap.c	19 Apr 2003 00:24:17 -0000	1.38
@@ -95,14 +95,13 @@
 
   /* find the circuit that we should use, if there is one. */
   circ = circuit_get_newest_by_edge_type(EDGE_AP);
-  circ->dirty = 1;
-
-  /* now we're all ready to make an onion or send a begin */
 
   if(!circ) {
     log(LOG_INFO,"ap_handshake_process_socks(): No circuit ready. Closing.");
     return -1;
   }
+
+  circ->dirty = 1;
 
   /* add it into the linked list of topics on this circuit */
   log(LOG_DEBUG,"ap_handshake_process_socks(): attaching new conn to circ. n_aci %d.", circ->n_aci);



More information about the tor-commits mailing list