From 52b11fa0364a180e8915578af30ffe02344e83a7 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 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 0035545..0606248 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; -- 1.6.6