mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6289 from ethereum/strictasm_fuzzer_ascii_only
Discard fuzz input containing non ASCII character(s).
This commit is contained in:
commit
834c23fc38
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user