[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Resolve a crash when running as dirauth
commit c98faa1a23661583ab92813bb569ce6b16ddb33b
Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Wed Nov 2 20:57:23 2011 +0100
Resolve a crash when running as dirauth
When we're asked for our own descriptor, don't crash.
---
changes/bridgeauth_crash | 4 ++++
src/or/dirserv.c | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/changes/bridgeauth_crash b/changes/bridgeauth_crash
new file mode 100644
index 0000000..74b9d03
--- /dev/null
+++ b/changes/bridgeauth_crash
@@ -0,0 +1,4 @@
+ o Major bugfixes:
+ - Don't crash when we, as the bridge authority, are asked for our own
+ descriptor. Bugfix on 0.2.3.7-alpha, reported by Lucky.
+
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 288fca9..4dc0403 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);
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits