]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Resolve a crash when running as dirauth
authorSebastian Hahn <sebastian@torproject.org>
Wed, 2 Nov 2011 19:57:23 +0000 (20:57 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 2 Nov 2011 19:57:23 +0000 (20:57 +0100)
When we're asked for our own descriptor, don't crash.

changes/bridgeauth_crash [new file with mode: 0644]
src/or/dirserv.c

diff --git a/changes/bridgeauth_crash b/changes/bridgeauth_crash
new file mode 100644 (file)
index 0000000..74b9d03
--- /dev/null
@@ -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.
+
index 288fca99b8d5af336acc46d3d824c60b82338f1e..4dc0403add7daea60cc87d6b70b748cc045425e8 100644 (file)
@@ -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);