Fix float fuzzer

This commit is contained in:
Victor Zverovich 2020-10-16 07:35:53 -07:00
parent 8d3fd86d6d
commit bd3c792507

View File

@ -28,7 +28,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
char* ptr = nullptr;
if (std::strtod(buffer.data(), &ptr) != value)
throw std::runtime_error("round trip failure");
if (ptr != buffer.end())
if (ptr + 1 != buffer.end())
throw std::runtime_error("unparsed output");
return 0;
}