Skip to content

Commit

Permalink
Show input data as string on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Jan 15, 2025
1 parent 3ce3179 commit 7326198
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fuzzing/fuzz_scientific_to_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, std::size_t size)
{
const boost::core::string_view sv{reinterpret_cast<const char*>(data), size};
using boost::locale::util::try_scientific_to_int;
try {
const boost::core::string_view sv{reinterpret_cast<const char*>(data), size};

uint8_t u8{};
try_scientific_to_int(sv, u8);
Expand All @@ -29,7 +29,7 @@ extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, std::size_t size
uint8_t u64{};
try_scientific_to_int(sv, u64);
} catch(...) {
std::cerr << "Error with '" << data << "' (size " << size << ')' << std::endl;
std::cerr << "Error with '" << sv << "' (size " << size << ')' << std::endl;
std::terminate();
}

Expand Down

0 comments on commit 7326198

Please sign in to comment.