This might make the fuzzer error debuggable. (#1345)

This commit is contained in:
Daniel Lemire 2020-12-16 18:31:29 -05:00 committed by GitHub
parent c578f63f34
commit c90ee57203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
const bool current=utf8verify(e);
std::cerr<<e->name()<<" returns "<<current<<std::endl;
}
std::cerr << "Offending input: \"";
for(size_t i = 0; i < Size; i++) {
std::cerr << "\\x" << std::hex << std::setw(2) << std::setfill('0') << uint32_t(Data[i]);
}
std::cerr << "\"" <<std::endl;
std::abort();
}