Fix flowbits sigmatch structure added to the match and post-match list, causing corruption of the prev ptr. This lead to an endless loop condition in the thresholding code. Thanks to Chris Wakelin for reporting the issue.

remotes/origin/master-1.2.x
Victor Julien 13 years ago
parent 39ef24ccc4
commit e81f94cd83

@ -258,6 +258,7 @@ int DetectFlowbitSetup (DetectEngineCtx *de_ctx, Signature *s, char *rawstr)
case DETECT_FLOWBITS_CMD_ISSET:
/* checks, so packet list */
SigMatchAppendPacket(s, sm);
break;
case DETECT_FLOWBITS_CMD_SET:
case DETECT_FLOWBITS_CMD_UNSET:

@ -1439,6 +1439,19 @@ static int SigValidate(Signature *s) {
}
}
#ifdef DEBUG
int i;
for (i = 0; i < DETECT_SM_LIST_MAX; i++) {
if (s->sm_lists[i] != NULL) {
SigMatch *sm;
for (sm = s->sm_lists[i]; sm != NULL; sm = sm->next) {
BUG_ON(sm == sm->prev);
BUG_ON(sm == sm->next);
}
}
}
#endif
SCReturnInt(1);
}

Loading…
Cancel
Save