CExtKey::Unserialize(...) and CExtPubKey::Unserialize(...) throw std::runtime_error instead of the expected std::ios_base::failure.
Context (taken from an e-mail):
When fuzzing some deserialization code I noticed that
CExtKey::Unserialize(...)andCExtPubKey::Unserialize(...)throwstd::runtime_errorinstead of thestd::ios_base::failureI expected in case of deserialization errors.I saw that this code was written by you originally: do you remember if there was a particular reason to go with
std::runtime_errorinstead ofstd::ios_base::failure? If not, do you think it would be safe to change it? :)
Code:
https://github.com/bitcoin/bitcoin/blob/376638afcf945ec43089625d115286594ce0ab16/src/key.h#L174-L183
FWIW the code paths in question are reachable by the fuzzers added in PR #17051 ("tests: Add deserialization fuzzing harnesses").