diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-02-03 10:14:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-02-03 10:35:07 -0500 |
commit | 19e25d5cabd23f28044ccbddc01e5cacbde2cfcb (patch) | |
tree | 5c7d209abd9dc33ab61990e05c783940e623dcd1 /src/or/rendservice.c | |
parent | 9d5a9feb404c61d93309eea1c68fcae3ff0cf8f3 (diff) | |
download | tor-19e25d5cabd23f28044ccbddc01e5cacbde2cfcb.tar.gz tor-19e25d5cabd23f28044ccbddc01e5cacbde2cfcb.zip |
Prevention: never die from extend_info_from_node() failure.
Bug 21242 occurred because we asserted that extend_info_from_node()
had succeeded...even though we already had the code to handle such a
failure. We fixed that in 93b39c51629ed0ded2bf807cb6.
But there were four other cases in our code where we called
extend_info_from_node() and either tor_assert()ed that it returned
non-NULL, or [in one case] silently assumed that it returned
non-NULL. That's not such a great idea. This patch makes those
cases check for a bug of this kind instead.
Fixes bug 21372; bugfix on 0.2.3.1-alpha when
extend_info_from_node() was introduced.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 4c5372cc43..1d6fc0f96d 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -4162,6 +4162,9 @@ rend_consider_services_intro_points(void) * even if we are a single onion service and intend to connect to it * directly ourselves. */ intro->extend_info = extend_info_from_node(node, 0); + if (BUG(intro->extend_info == NULL)) { + break; + } intro->intro_key = crypto_pk_new(); const int fail = crypto_pk_generate_key(intro->intro_key); tor_assert(!fail); |