[or-cvs] fix a rare seg fault for people running hidden services on

Roger Dingledine arma at seul.org
Mon Sep 20 03:07:13 UTC 2004


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

Modified Files:
	rendservice.c 
Log Message:
fix a rare seg fault for people running hidden services on
intermittent connections


Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- rendservice.c	8 Sep 2004 07:16:33 -0000	1.82
+++ rendservice.c	20 Sep 2004 03:07:11 -0000	1.83
@@ -264,6 +264,11 @@
   d->intro_points = tor_malloc(sizeof(char*)*n);
   for (i=0; i < n; ++i) {
     router = router_get_by_nickname(smartlist_get(service->intro_nodes, i));
+    if(!router) {
+      log_fn(LOG_WARN,"Router '%s' not found. Skipping.",
+             (char*)smartlist_get(service->intro_nodes, i));
+      continue;
+    }
     circ = find_intro_circuit(router, service->pk_digest);
     if (circ && circ->purpose == CIRCUIT_PURPOSE_S_INTRO) {
       /* We have an entirely established intro circuit. */
@@ -718,6 +723,7 @@
 {
   circuit_t *circ = NULL;
 
+  tor_assert(router);
   while ((circ = circuit_get_next_by_pk_and_purpose(circ,pk_digest,
                                                   CIRCUIT_PURPOSE_S_INTRO))) {
     tor_assert(circ->cpath);



More information about the tor-commits mailing list