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 f898ef65c9, #18994).
This commit is contained in:
Sebastian Falbesoner
2026-06-07 20:43:42 +02:00
parent 27472a542c
commit 5deb053a75

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());