[or-cvs] backport patch from pre1:

Roger Dingledine arma at seul.org
Wed Oct 13 21:34:25 UTC 2004


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

Modified Files:
      Tag: tor-0_0_8-patches
	rendservice.c 
Log Message:
backport patch from pre1:
fix a rare seg fault for people running hidden services on
intermittent connections


Index: rendservice.c
===================================================================
RCS file: /home2/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.81
retrieving revision 1.81.2.1
diff -u -d -r1.81 -r1.81.2.1
--- rendservice.c	18 Aug 2004 05:05:58 -0000	1.81
+++ rendservice.c	13 Oct 2004 21:34:23 -0000	1.81.2.1
@@ -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