]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
dns: Remove reachable BUG()
authorDavid Goulet <dgoulet@torproject.org>
Wed, 16 Mar 2022 17:42:42 +0000 (13:42 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Wed, 16 Mar 2022 17:42:42 +0000 (13:42 -0400)
Fixes #40587

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/feature/relay/dns.c

index 0af80d52ae30fd58384b8d46fce37ea0d609631e..4ae4a8e4b9dffbdb918b3c314d7a2f57a21556e7 100644 (file)
@@ -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;
   }