tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 485990641ba765414a0e69ce7f2cc57f018c3bed
parent e8a4482335a1ed6b8238fc7114e3fdd3d7fa9028
Author: Alexander Færøy <ahf@torproject.org>
Date:   Fri, 18 Sep 2020 14:51:54 +0000

Merge remote-tracking branch 'tor-gitlab/mr/137'

Diffstat:
Achanges/ticket40073 | 3+++
Msrc/core/mainloop/connection.c | 9++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/changes/ticket40073 b/changes/ticket40073 @@ -0,0 +1,3 @@ + o Minor bugfixes (relay configuration, crash): + - Avoid a fatal assert() when failing to create a listener connection for an + address that was in use. Fixes bug 40073; bugfix on 0.3.5.1-alpha. diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c @@ -3224,7 +3224,14 @@ retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol) &skip, &addr_in_use); } - tor_assert(new_conn); + /* There are many reasons why we can't open a new listener port so in case + * we hit those, bail early so tor can stop. */ + if (!new_conn) { + log_warn(LD_NET, "Unable to create listener port: %s:%d", + fmt_addr(&r->new_port->addr), r->new_port->port); + retval = -1; + break; + } smartlist_add(new_conns, new_conn);