[or-cvs] fix a pair of lurking segfaults

Roger Dingledine arma at seul.org
Tue Mar 2 18:08:10 UTC 2004


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

Modified Files:
	circuit.c 
Log Message:
fix a pair of lurking segfaults


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- circuit.c	2 Mar 2004 17:48:16 -0000	1.145
+++ circuit.c	2 Mar 2004 18:08:07 -0000	1.146
@@ -65,8 +65,11 @@
     global_circuitlist = tmp;
   }
 
+  if(!global_circuitlist)
+    return;
+
   for (tmp = global_circuitlist; tmp->next; tmp=tmp->next) {
-    while (tmp->next->marked_for_close) {
+    while (tmp->next && tmp->next->marked_for_close) {
       m = tmp->next->next;
       circuit_free(tmp->next);
       tmp->next = m;



More information about the tor-commits mailing list