tor

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

commit 95f84c96ce75256748e092db91c6ebaef470281e
parent 892d0f4517c29cbf4b66663734bec5f07690adc9
Author: David Goulet <dgoulet@torproject.org>
Date:   Thu, 20 Nov 2025 16:00:03 +0000

Merge branch 'fc43_fixes' into 'main'

Fix new (to me) warnings from shellcheck and clang.

Closes #41166

See merge request tpo/core/tor!954
Diffstat:
Achanges/fc43-warnings | 3+++
Mscripts/codegen/run_trunnel.sh | 3+--
Mscripts/maint/code-format.sh | 4++--
Mscripts/maint/run_calltool.sh | 3+--
Mscripts/test/scan-build.sh | 2+-
Msrc/test/test_circuitpadding.c | 2+-
Msrc/test/test_conflux_pool.c | 2+-
Msrc/test/test_hs_client.c | 4++--
Msrc/test/test_hs_intropoint.c | 2+-
Msrc/test/test_include.sh | 2+-
Msrc/test/test_rebind.sh | 2+-
11 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/changes/fc43-warnings b/changes/fc43-warnings @@ -0,0 +1,3 @@ + o Minor bugfixes (warnings): + - Fix minor warnings from newer versions of shellcheck and clang. + Fixes bug 41166; bugfix on 0.4.3.1-alpha and several other versions. diff --git a/scripts/codegen/run_trunnel.sh b/scripts/codegen/run_trunnel.sh @@ -1,6 +1,6 @@ #!/bin/sh -if test "x$TRUNNEL_PATH" != "x"; then +if test "$TRUNNEL_PATH" != ""; then PYTHONPATH="${TRUNNEL_PATH}:${PYTHONPATH}" export PYTHONPATH fi @@ -12,4 +12,3 @@ OPTIONS="--require-version=1.5.1" find ./src/trunnel/ -name '*.trunnel' -exec python -m trunnel ${OPTIONS} {} \; python -m trunnel ${OPTIONS} --write-c-files --target-dir=./src/ext/trunnel/ - diff --git a/scripts/maint/code-format.sh b/scripts/maint/code-format.sh @@ -162,7 +162,7 @@ if [[ $GITIDX = 1 ]]; then git stash -q --keep-index # For some reasons, shellcheck is not seeing that we can call this # function from the trap below. - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 function restoregit() { note "Restoring git state" git stash pop -q @@ -170,7 +170,7 @@ if [[ $GITIDX = 1 ]]; then else # For some reasons, shellcheck is not seeing that we can call this # function from the trap below. - # shellcheck disable=SC2317 + # shellcheck disable=SC2317,SC2329 function restoregit() { true } diff --git a/scripts/maint/run_calltool.sh b/scripts/maint/run_calltool.sh @@ -4,7 +4,7 @@ set -e -if test "x$CALLTOOL_PATH" != "x"; then +if test "$CALLTOOL_PATH" != ""; then PYTHONPATH="${CALLTOOL_PATH}:${PYTHONPATH}" export PYTHONPATH fi @@ -26,4 +26,3 @@ the calltool distribution. You can find calltool at https://gitweb.torproject.org/user/nickm/calltool.git EOF - diff --git a/scripts/test/scan-build.sh b/scripts/test/scan-build.sh @@ -48,7 +48,7 @@ NOISY_CHECKERS="\ -enable-checker alpha.deadcode.UnreachableCode \ " -if test "x$SCAN_BUILD_OUTPUT" != "x"; then +if test "$SCAN_BUILD_OUTPUT" != ""; then OUTPUTARG="-o $SCAN_BUILD_OUTPUT" else OUTPUTARG="" diff --git a/src/test/test_circuitpadding.c b/src/test/test_circuitpadding.c @@ -1588,7 +1588,7 @@ simulate_single_hop_extend(circuit_t *client, circuit_t *mid_relay, { char whatevs_key[CPATH_KEY_MATERIAL_LEN]; char digest[DIGEST_LEN]; - tor_addr_t addr; + tor_addr_t addr = TOR_ADDR_NULL; // Pretend a non-padding cell was sent circpad_cell_event_nonpadding_sent(client); diff --git a/src/test/test_conflux_pool.c b/src/test/test_conflux_pool.c @@ -336,7 +336,7 @@ simulate_single_hop_extend(origin_circuit_t *client, int exit) { char whatevs_key[CPATH_KEY_MATERIAL_LEN]; char digest[DIGEST_LEN]; - tor_addr_t addr; + tor_addr_t addr = TOR_ADDR_NULL; // Advance time a tiny bit so we can calculate an RTT curr_mocked_time += 10 * TOR_NSEC_PER_MSEC; diff --git a/src/test/test_hs_client.c b/src/test/test_hs_client.c @@ -1094,7 +1094,7 @@ test_socks_hs_errors(void *arg) char *desc_encoded = NULL; circuit_t *circ = NULL; origin_circuit_t *ocirc = NULL; - tor_addr_t addr; + tor_addr_t addr = TOR_ADDR_NULL; ed25519_keypair_t service_kp; ed25519_keypair_t signing_kp; entry_connection_t *socks_conn = NULL; @@ -1268,7 +1268,7 @@ test_close_intro_circuit_failure(void *arg) circuit_t *circ = NULL; ed25519_keypair_t service_kp, intro_kp; origin_circuit_t *ocirc = NULL; - tor_addr_t addr; + tor_addr_t addr = TOR_ADDR_NULL; const hs_cache_intro_state_t *entry; (void) arg; diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c @@ -544,7 +544,7 @@ test_intro_point_registration(void *arg) or_circuit_t *intro_circ = NULL; trn_cell_establish_intro_t *establish_intro_cell = NULL; - ed25519_public_key_t auth_key; + ed25519_public_key_t auth_key = {0}; or_circuit_t *returned_intro_circ = NULL; diff --git a/src/test/test_include.sh b/src/test/test_include.sh @@ -50,7 +50,7 @@ fi tmpdir= # For some reasons, shellcheck is not seeing that we can call this # function from the trap below. -# shellcheck disable=SC2317 +# shellcheck disable=SC2317,SC2329 clean () { if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then rm -rf "$tmpdir" diff --git a/src/test/test_rebind.sh b/src/test/test_rebind.sh @@ -48,7 +48,7 @@ fi tmpdir= # For some reasons, shellcheck is not seeing that we can call this # function from the trap below. -# shellcheck disable=SC2317 +# shellcheck disable=SC2317,SC2329 clean () { if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then ls -l "$tmpdir"