From a9c4dbaf90e529dffb87083fff06059638ac9512 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 7 Jan 2025 16:55:35 +0100 Subject: [PATCH] fuzz: use lower pcre limits to avoid timeouts instead of forbidding pcre signatures on stream Ticket: 4858 (cherry picked from commit 7750226e435228dca21ae6c22860921aa0497883) --- src/detect-pcre.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/detect-pcre.h b/src/detect-pcre.h index 79fd1af74a..42d149e144 100644 --- a/src/detect-pcre.h +++ b/src/detect-pcre.h @@ -37,8 +37,13 @@ #define DETECT_PCRE_CAPTURE_MAX 8 +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#define SC_MATCH_LIMIT_DEFAULT 350 +#define SC_MATCH_LIMIT_RECURSION_DEFAULT 150 +#else #define SC_MATCH_LIMIT_DEFAULT 3500 #define SC_MATCH_LIMIT_RECURSION_DEFAULT 1500 +#endif typedef struct DetectPcreData_ { /* pcre options */