From 9e4da4f8e7d3827e94d9caa2b72585647ed8963c Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 12 Feb 2010 14:32:11 -0800 Subject: [PATCH] supply pcre_get_substring with the proper start of the string. --- src/detect-pcre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 0035545715..0606248336 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -256,7 +256,7 @@ DetectPcreData *DetectPcreParse (char *regexstr) if (ret > 1) { const char *str_ptr; - res = pcre_get_substring((char *)regexstr, ov, MAX_SUBSTRINGS, 1, &str_ptr); + res = pcre_get_substring((char *)regexstr+pos, ov, MAX_SUBSTRINGS, 1, &str_ptr); if (res < 0) { printf("DetectPcreParse: pcre_get_substring failed\n"); return NULL; @@ -264,7 +264,7 @@ DetectPcreData *DetectPcreParse (char *regexstr) re = (char *)str_ptr; if (ret > 2) { - res = pcre_get_substring((char *)regexstr, ov, MAX_SUBSTRINGS, 2, &str_ptr); + res = pcre_get_substring((char *)regexstr+pos, ov, MAX_SUBSTRINGS, 2, &str_ptr); if (res < 0) { printf("DetectPcreParse: pcre_get_substring failed\n"); return NULL;