diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-06-28 13:57:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-06-28 13:57:54 -0400 |
commit | 40602537493409bcf3c4eaeda7fbee6c6eb3f329 (patch) | |
tree | 4d6c10770214c11a9178b6e82ea13d4d1da63814 /src | |
parent | 711160a46f5fbba7106c23c29f99bed75928a5a7 (diff) | |
parent | 4b5cdb2c3060eefcc616764845a4ed7c002117b7 (diff) | |
download | tor-40602537493409bcf3c4eaeda7fbee6c6eb3f329.tar.gz tor-40602537493409bcf3c4eaeda7fbee6c6eb3f329.zip |
Merge remote-tracking branch 'teor/bug21576_029_v2' into maint-0.2.9
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 3550d0e212..f033d17adb 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2437,10 +2437,16 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn) } else if (begin_type == RELAY_COMMAND_BEGIN_DIR) { /* This connection is a begindir directory connection. * Look at the linked directory connection to access the directory purpose. - * (This must be non-NULL, because we're doing begindir.) */ - tor_assert(base_conn->linked); + * If a BEGINDIR connection is ever not linked, that's a bug. */ + if (BUG(!base_conn->linked)) { + return -1; + } connection_t *linked_dir_conn_base = base_conn->linked_conn; - tor_assert(linked_dir_conn_base); + /* If the linked connection has been unlinked by other code, we can't send + * a begin cell on it. */ + if (!linked_dir_conn_base) { + return -1; + } /* Sensitive directory connections must have an anonymous path length. * Otherwise, directory connections are typically one-hop. * This matches the earlier check for directory connection path anonymity |