supply pcre_get_substring with the proper start of the string.

remotes/origin/master-1.0.x
Jason Ish 15 years ago committed by Victor Julien
parent a8c3718b56
commit 9e4da4f8e7

@ -256,7 +256,7 @@ DetectPcreData *DetectPcreParse (char *regexstr)
if (ret > 1) { if (ret > 1) {
const char *str_ptr; 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) { if (res < 0) {
printf("DetectPcreParse: pcre_get_substring failed\n"); printf("DetectPcreParse: pcre_get_substring failed\n");
return NULL; return NULL;
@ -264,7 +264,7 @@ DetectPcreData *DetectPcreParse (char *regexstr)
re = (char *)str_ptr; re = (char *)str_ptr;
if (ret > 2) { 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) { if (res < 0) {
printf("DetectPcreParse: pcre_get_substring failed\n"); printf("DetectPcreParse: pcre_get_substring failed\n");
return NULL; return NULL;

Loading…
Cancel
Save