aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/parse_univalue.cpp
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2023-07-26 11:39:54 +0200
committerTheCharlatan <seb.kung@gmail.com>2023-07-27 09:36:05 +0200
commit06199a995f20c55583f6948cfe99e608679fcdf1 (patch)
tree548887a67d57fc0daf2291c69c321cfea7c8a03b /src/test/fuzz/parse_univalue.cpp
parent0b47c1621524a96b79cbdc3c45ee5ad36e7ba541 (diff)
downloadbitcoin-06199a995f20c55583f6948cfe99e608679fcdf1.tar.xz
refactor: Revert addition of univalue sighash string check
This check is already done by the rpc parser. Re-doing it is adding dead code. Instead, throwing an exception when the assumption does not hold is the already correct behavior. To make the fuzz test more accurate and not swallow all runtime errors, add a check that the passed in UniValue sighash argument is either a string or null. Co-authored-by: stickies-v <stickies-v@protonmail.com>
Diffstat (limited to 'src/test/fuzz/parse_univalue.cpp')
-rw-r--r--src/test/fuzz/parse_univalue.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/fuzz/parse_univalue.cpp b/src/test/fuzz/parse_univalue.cpp
index c9096d0386..a3d6ab6375 100644
--- a/src/test/fuzz/parse_univalue.cpp
+++ b/src/test/fuzz/parse_univalue.cpp
@@ -67,7 +67,7 @@ FUZZ_TARGET(parse_univalue, .init = initialize_parse_univalue)
} catch (const std::runtime_error&) {
}
try {
- (void)ParseSighashString(univalue);
+ if (univalue.isNull() || univalue.isStr()) (void)ParseSighashString(univalue);
} catch (const UniValue&) {
}
try {