Merge bitcoin/bitcoin#35481: fuzz: fix dead HD keypaths (de)serialization round-trip

5deb053a75 fuzz: fix dead HD keypaths (de)serialization round-trip (Sebastian Falbesoner)

Pull request description:

  `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 f898ef65c9, #18994).

ACKs for top commit:
  sedited:
    ACK 5deb053a75

Tree-SHA512: 0d8770aa5da2e132caedd522c8c95c4ceb6d1bcc4d5b6605784fd7d2df41fce29fcd25fc2741c4e751b942b548888833eb9d9d6318505a5c59f7b1f105c990ae
This commit is contained in:
merge-script
2026-06-07 22:12:29 +02:00

View File

@@ -67,7 +67,7 @@ FUZZ_TARGET(script_sign, .init = initialize_script_sign)
}
std::map<CPubKey, KeyOriginInfo> 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());