Skip to content

Commit c90ee57

Browse files
authored
This might make the fuzzer error debuggable. (simdjson#1345)
1 parent c578f63 commit c90ee57

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fuzz/fuzz_utf8.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
4545
const bool current=utf8verify(e);
4646
std::cerr<<e->name()<<" returns "<<current<<std::endl;
4747
}
48+
std::cerr << "Offending input: \"";
49+
for(size_t i = 0; i < Size; i++) {
50+
std::cerr << "\\x" << std::hex << std::setw(2) << std::setfill('0') << uint32_t(Data[i]);
51+
}
52+
std::cerr << "\"" <<std::endl;
53+
4854
std::abort();
4955
}
5056

0 commit comments

Comments
 (0)