aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-11-02 20:57:23 +0100
committerSebastian Hahn <sebastian@torproject.org>2011-11-02 20:57:23 +0100
commitc98faa1a23661583ab92813bb569ce6b16ddb33b (patch)
tree8b50722a74e832e2b3d5cd3225f5abe9b4ad7229 /src/or/dirserv.c
parentc58f4a86521d3d222d60787d63f6040f73a4c054 (diff)
downloadtor-c98faa1a23661583ab92813bb569ce6b16ddb33b.tar.gz
tor-c98faa1a23661583ab92813bb569ce6b16ddb33b.zip
Resolve a crash when running as dirauth
When we're asked for our own descriptor, don't crash.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 288fca99b8..4dc0403add 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3590,8 +3590,9 @@ connection_dirserv_add_servers_to_outbuf(dir_connection_t *conn)
if (options->BridgeAuthoritativeDir && by_fp) {
const routerinfo_t *router =
router_get_by_id_digest(sd->identity_digest);
- tor_assert(router);
- if (router->purpose == ROUTER_PURPOSE_BRIDGE)
+ /* router can be NULL here when the bridge auth is asked for its own
+ * descriptor. */
+ if (router && router->purpose == ROUTER_PURPOSE_BRIDGE)
rep_hist_note_desc_served(sd->identity_digest);
}
body = signed_descriptor_get_body(sd);