[tor-commits] [tor/master] Don't assume that a node has routerinfo.
nickm at torproject.org
nickm at torproject.org
Thu Jul 19 21:53:06 UTC 2012
commit c1ff07440e67f1ae690acbfceddb6174fdb092df
Author: Linus Nordberg <linus at nordberg.se>
Date: Tue May 8 14:53:59 2012 +0200
Don't assume that a node has routerinfo.
We can end up in dirserv_orconn_tls_done() with a node missing
routerinfo in at least two cases -- command_process_certs_cell() and
connection_or_check_valid_tls_handshake() -- and probably more.
---
src/or/dirserv.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 8f65b7f..3518d9e 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3284,10 +3284,9 @@ dirserv_orconn_tls_done(const char *address,
tor_assert(digest_rcvd);
node = node_get_mutable_by_id(digest_rcvd);
- if (node == NULL)
+ if (node == NULL || node->ri == NULL)
return;
ri = node->ri;
- tor_assert(ri);
if (!strcasecmp(address, ri->address) && or_port == ri->or_port) {
/* Found the right router. */
More information about the tor-commits
mailing list