From: Victor Julien Date: Thu, 30 Jun 2022 14:52:44 +0000 (+0200) Subject: detect: impose limits on pcrexform X-Git-Tag: suricata-6.0.6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7596%2Fhead;p=thirdparty%2Fsuricata.git detect: impose limits on pcrexform Impose match and recursion limits on pcrexform keywords. Based on: 585e5e0d3c4e ("detect: impose limits on pcrexform") Bug: #5414. --- diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 5644b55231..e54e75a7b8 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -65,9 +65,6 @@ #define PARSE_CAPTURE_REGEX "\\(\\?P\\<([A-z]+)\\_([A-z0-9_]+)\\>" #define PARSE_REGEX "(?study != NULL) { + pxd->study->match_limit = SC_MATCH_LIMIT_DEFAULT; + pxd->study->flags |= PCRE_EXTRA_MATCH_LIMIT; +#ifndef NO_PCRE_MATCH_RLIMIT + pxd->study->match_limit_recursion = SC_MATCH_LIMIT_RECURSION_DEFAULT; + pxd->study->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; +#endif + } + int r = DetectSignatureAddTransform(s, DETECT_TRANSFORM_PCREXFORM, pxd); if (r != 0) { SCFree(pxd);