mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-15 17:21:09 +02:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user