tor

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

commit 1f783bab40e489524565c824e0e9fe8a116d7079
parent f64a88e72d691cabc88544d7cb3f85c89573ed90
Author: David Goulet <dgoulet@torproject.org>
Date:   Wed, 16 Mar 2022 13:42:42 -0400

dns: Remove reachable BUG()

Fixes #40587

Signed-off-by: David Goulet <dgoulet@torproject.org>

Diffstat:
Msrc/feature/relay/dns.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c @@ -1416,12 +1416,15 @@ get_consensus_param_exit_dns_attempts(void) return str; } -/** Configure the libevent options. This can be called after initialization. - * This should never be called without the evdns base pointer initialized. */ +/** Configure the libevent options. This can safely be called after + * initialization or even if the evdns base is not set. */ static void configure_libevent_options(void) { - if (BUG(!the_evdns_base)) { + /* This is possible because we can get called when a new consensus is set + * while the DNS subsystem is not initialized just yet. It should be + * harmless. */ + if (!the_evdns_base) { return; }