From 4fe4de6364b05d2abde196b486b6e3f254d18026 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 14 Jan 2020 16:39:23 +0000 Subject: [PATCH] tests: Fuzz additional functions in the hex fuzzing harness --- src/test/fuzz/hex.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/test/fuzz/hex.cpp b/src/test/fuzz/hex.cpp index 54693180be1..2de6100d7b6 100644 --- a/src/test/fuzz/hex.cpp +++ b/src/test/fuzz/hex.cpp @@ -2,8 +2,12 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include +#include +#include #include - +#include +#include #include #include @@ -19,4 +23,14 @@ void test_one_input(const std::vector& buffer) if (IsHex(random_hex_string)) { assert(ToLower(random_hex_string) == hex_data); } + (void)IsHexNumber(random_hex_string); + uint256 result; + (void)ParseHashStr(random_hex_string, result); + (void)uint256S(random_hex_string); + try { + (void)HexToPubKey(random_hex_string); + } catch (const UniValue&) { + } + CBlockHeader block_header; + (void)DecodeHexBlockHeader(block_header, random_hex_string); }