tor

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

commit 6c0d17a3444322300ec4fbf5f342db0f1d78fa55
parent 2cfa7e0fc0a8e6563598014d5dd3e3b8fcc45f32
Author: David Goulet <dgoulet@torproject.org>
Date:   Wed, 19 Mar 2025 18:08:55 +0000

Merge branch 'repair-disable-relay' into 'main'

Fix compilation with --disable-module-relay

Closes #41032

See merge request tpo/core/tor!866
Diffstat:
Achanges/bug41032 | 2++
Msrc/app/main/main.c | 2++
Msrc/feature/nodelist/networkstatus.c | 3++-
Msrc/feature/relay/relay_handshake.h | 1-
4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/changes/bug41032 b/changes/bug41032 @@ -0,0 +1,2 @@ + o Minor features (compilation): + - Fix a warning when compiling with GCC 14.2. Closes 41032. diff --git a/src/app/main/main.c b/src/app/main/main.c @@ -957,6 +957,7 @@ sandbox_init_filter(void) OPEN("/etc/hosts"); OPEN("/proc/meminfo"); +#ifdef HAVE_MODULE_RELAY { smartlist_t *family_id_files = list_family_key_files(options, options->KeyDirectory); @@ -967,6 +968,7 @@ sandbox_init_filter(void) SMARTLIST_FOREACH(family_id_files, char *, cp, tor_free(cp)); smartlist_free(family_id_files); } +#endif if (options->BridgeAuthoritativeDir) OPEN_DATADIR_SUFFIX("networkstatus-bridges", ".tmp"); diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c @@ -1954,7 +1954,7 @@ networkstatus_set_current_consensus(const char *consensus, int free_consensus = 1; /* Free 'c' at the end of the function */ int checked_protocols_already = 0; - if (flav < 0) { + if (flav < 0 || flav >= N_CONSENSUS_FLAVORS) { /* XXXX we don't handle unrecognized flavors yet. */ log_warn(LD_BUG, "Unrecognized consensus flavor %s", flavor); return -2; @@ -1982,6 +1982,7 @@ networkstatus_set_current_consensus(const char *consensus, if ((int)c->flavor != flav) { /* This wasn't the flavor we thought we were getting. */ + tor_assert(c->flavor < N_CONSENSUS_FLAVORS); if (require_flavor) { log_warn(LD_DIR, "Got consensus with unexpected flavor %s (wanted %s)", networkstatus_get_flavor_name(c->flavor), flavor); diff --git a/src/feature/relay/relay_handshake.h b/src/feature/relay/relay_handshake.h @@ -60,7 +60,6 @@ connection_or_compute_authenticate_cell_body( { (void)conn; (void)authtype; - (void)signing_key; (void)ed_signing_key; (void)server; tor_assert_nonfatal_unreached();