Discard fuzz input containing at least one character not in the following set: "isprint"able, newline, and horizontal

Co-Authored-By: bshastry <bshastry@ethereum.org>
This commit is contained in:
Bhargava Shastry 2019-03-14 14:58:24 +01:00
parent 48f0d41cc5
commit 725fc898fd

View File

@ -50,6 +50,11 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
string input(reinterpret_cast<char const*>(_data), _size);
if (std::any_of(input.begin(), input.end(), [](char c) {
return ((static_cast<unsigned char>(c) > 127) || !(std::isprint(c) || (c == '\n') || (c == '\t')));
}))
return 0;
AssemblyStack stack(EVMVersion::petersburg(), AssemblyStack::Language::StrictAssembly);
try
{