From 229e1f127aeb3bf61d5301b1afc54bdb08858cdc Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Thu, 5 Mar 2026 10:24:14 +0100 Subject: [PATCH] surjection: Fix read of uninitialized value in tests --- src/modules/surjection/tests_impl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/surjection/tests_impl.h b/src/modules/surjection/tests_impl.h index 731e2fd4..6083deb8 100644 --- a/src/modules/surjection/tests_impl.h +++ b/src/modules/surjection/tests_impl.h @@ -438,6 +438,9 @@ static void test_bad_serialize(void) { size_t serialized_len; proof.n_inputs = 0; + memset(proof.used_inputs, 0, SECP256K1_SURJECTIONPROOF_MAX_N_INPUTS / 8); + memset(proof.data, 0, 32 * (1 + SECP256K1_SURJECTIONPROOF_MAX_USED_INPUTS)); + serialized_len = 2 + 31; /* e0 is one byte too short */ CHECK(secp256k1_surjectionproof_serialize(CTX, serialized_proof, &serialized_len, &proof) == 0);