Skip to content

Commit 4fe4de6

Browse files
tests: Fuzz additional functions in the hex fuzzing harness
1 parent c7ea12d commit 4fe4de6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/test/fuzz/hex.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <core_io.h>
6+
#include <primitives/block.h>
7+
#include <rpc/util.h>
58
#include <test/fuzz/fuzz.h>
6-
9+
#include <uint256.h>
10+
#include <univalue.h>
711
#include <util/strencodings.h>
812

913
#include <cassert>
@@ -19,4 +23,14 @@ void test_one_input(const std::vector<uint8_t>& buffer)
1923
if (IsHex(random_hex_string)) {
2024
assert(ToLower(random_hex_string) == hex_data);
2125
}
26+
(void)IsHexNumber(random_hex_string);
27+
uint256 result;
28+
(void)ParseHashStr(random_hex_string, result);
29+
(void)uint256S(random_hex_string);
30+
try {
31+
(void)HexToPubKey(random_hex_string);
32+
} catch (const UniValue&) {
33+
}
34+
CBlockHeader block_header;
35+
(void)DecodeHexBlockHeader(block_header, random_hex_string);
2236
}

0 commit comments

Comments
 (0)