[fuzzer] Fix mistakes in the parser and scalar fuzzers. (#6314)

The flatbuffers::Parser::Parse() isn't an idempotent method for schema parsing.
This commit removes a wrong for-loop that tried to check the same schema twice.
This commit is contained in:
Vladimir Glavnyy
2020-12-08 02:47:33 +07:00
committed by GitHub
parent fc960f3670
commit bc7eb8adeb
2 changed files with 10 additions and 22 deletions

View File

@@ -234,7 +234,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
const uint8_t flags = data[0];
// normalize to ascii alphabet
const int extra_rep_number =
std::max(5, (data[1] < '0' ? (data[1] - '0') : 0));
std::max(5, (data[1] > '0' ? (data[1] - '0') : 0));
data += 2;
size -= 2; // bypass