pcre: fix var capture for non relative matches

Var capture setup depended on the match being relative due to a logic
error.
pull/1231/head
Victor Julien 11 years ago
parent 1ad2a231fe
commit ee8da21e36

@ -737,6 +737,11 @@ static int DetectPcreSetup (DetectEngineCtx *de_ctx, Signature *s, char *regexst
sm->ctx = (void *)pd; sm->ctx = (void *)pd;
SigMatchAppendSMToList(s, sm, sm_list); SigMatchAppendSMToList(s, sm, sm_list);
if (pd->capidx != 0) {
if (DetectFlowvarPostMatchSetup(s, pd->capidx) < 0)
goto error_nofree;
}
if (!(pd->flags & DETECT_PCRE_RELATIVE)) if (!(pd->flags & DETECT_PCRE_RELATIVE))
goto okay; goto okay;
@ -760,11 +765,6 @@ static int DetectPcreSetup (DetectEngineCtx *de_ctx, Signature *s, char *regexst
tmp->flags |= DETECT_PCRE_RELATIVE_NEXT; tmp->flags |= DETECT_PCRE_RELATIVE_NEXT;
} }
if (pd->capidx != 0) {
if (DetectFlowvarPostMatchSetup(s, pd->capidx) < 0)
goto error_nofree;
}
okay: okay:
ret = 0; ret = 0;
SCReturnInt(ret); SCReturnInt(ret);

Loading…
Cancel
Save