Merge pull request #6289 from ethereum/strictasm_fuzzer_ascii_only

Discard fuzz input containing non ASCII character(s).
This commit is contained in:
chriseth 2019-03-18 11:44:06 +01:00 committed by GitHub
commit 834c23fc38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
{