From: Roger Dingledine Date: Mon, 20 Sep 2004 03:07:11 +0000 (+0000) Subject: fix a rare seg fault for people running hidden services on X-Git-Tag: tor-0.0.9pre1~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=802b203ff167df4aaf5c26bda1cf6f407530e6d7;p=thirdparty%2Ftor.git fix a rare seg fault for people running hidden services on intermittent connections svn:r2353 --- diff --git a/src/or/rendservice.c b/src/or/rendservice.c index cfc5841120..3a8fdbf666 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -264,6 +264,11 @@ static void rend_service_update_descriptor(rend_service_t *service) 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 @@ find_intro_circuit(routerinfo_t *router, const char *pk_digest) { 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);