From 5d05f810d0a32516744ceb85106d64ed95fa062f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 6 Oct 2021 19:14:20 +0200 Subject: [PATCH] Reduce max input size in parser fuzzer Still seeing stack overflows for $$$$$x style input, let's reduce the input size limit further... --- sapi/fuzzer/fuzzer-parser.c | 2 +- sapi/fuzzer/generate_parser_corpus.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/fuzzer/fuzzer-parser.c b/sapi/fuzzer/fuzzer-parser.c index 427720a1dca..28030d95d9a 100644 --- a/sapi/fuzzer/fuzzer-parser.c +++ b/sapi/fuzzer/fuzzer-parser.c @@ -26,7 +26,7 @@ #include "fuzzer-sapi.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size > 7 * 1024) { + if (Size > 6 * 1024) { /* Large inputs have a large impact on fuzzer performance and may cause stack overflows, * but are unlikely to be necessary to reach new codepaths. */ return 0; diff --git a/sapi/fuzzer/generate_parser_corpus.php b/sapi/fuzzer/generate_parser_corpus.php index 308c4fdee30..036ca42e370 100644 --- a/sapi/fuzzer/generate_parser_corpus.php +++ b/sapi/fuzzer/generate_parser_corpus.php @@ -9,7 +9,7 @@ $it = new RecursiveIteratorIterator( $corpusDir = __DIR__ . '/corpus/parser'; @mkdir($corpusDir); -$maxLen = 7 * 1024; +$maxLen = 6 * 1024; foreach ($it as $file) { if (!preg_match('/\.phpt$/', $file)) continue; $code = file_get_contents($file);