#define PARSE_CAPTURE_REGEX "\\(\\?P\\<([A-z]+)\\_([A-z0-9_]+)\\>"
#define PARSE_REGEX "(?<!\\\\)/(.*(?<!(?<!\\\\)\\\\))/([^\"]*)"
-#define SC_MATCH_LIMIT_DEFAULT 3500
-#define SC_MATCH_LIMIT_RECURSION_DEFAULT 1500
-
static int pcre_match_limit = 0;
static int pcre_match_limit_recursion = 0;
#define DETECT_PCRE_CAPTURE_MAX 8
+#define SC_MATCH_LIMIT_DEFAULT 3500
+#define SC_MATCH_LIMIT_RECURSION_DEFAULT 1500
+
typedef struct DetectPcreData_ {
/* pcre options */
DetectParseRegex parse_regex;
#include "detect.h"
#include "detect-engine.h"
#include "detect-parse.h"
+#include "detect-pcre.h"
#include "detect-transform-pcrexform.h"
typedef DetectParseRegex DetectTransformPcrexformData;
SCReturnInt(-1);
}
+ if (pxd->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);