From 5deb053a75fb0529618a2980d9b6a6ba9928d039 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sun, 7 Jun 2026 20:43:42 +0200 Subject: [PATCH] fuzz: fix dead HD keypaths (de)serialization round-trip `DeserializeHDKeypaths()` was writing into the original `hd_keypaths` map instead of `deserialized_hd_keypaths`. As a result the latter was always empty and the round-trip assertion following was trivially true, so the serialize/deserialize round-trip wasn't actually being exercised. That bug was introduced with the commit introducing the fuzz target (commit f898ef65c947776750e49d050633f830546bbdc6, #18994). --- src/test/fuzz/script_sign.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/fuzz/script_sign.cpp b/src/test/fuzz/script_sign.cpp index 036b9ff3e49b..ba269beddd4e 100644 --- a/src/test/fuzz/script_sign.cpp +++ b/src/test/fuzz/script_sign.cpp @@ -67,7 +67,7 @@ FUZZ_TARGET(script_sign, .init = initialize_script_sign) } std::map deserialized_hd_keypaths; try { - DeserializeHDKeypaths(serialized, key, hd_keypaths); + DeserializeHDKeypaths(serialized, key, deserialized_hd_keypaths); } catch (const std::ios_base::failure&) { } assert(hd_keypaths.size() >= deserialized_hd_keypaths.size());