Add some safety checks.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 06a640e794
commit 9ee6d6906f

@ -91,6 +91,7 @@ MpmMatchCleanup(MpmThreadCtx *thread_ctx) {
MpmMatch *m = thread_ctx->qlist; MpmMatch *m = thread_ctx->qlist;
while (m != NULL) { while (m != NULL) {
BUG_ON(m == m->qnext);
nxt = m->qnext; nxt = m->qnext;
/* clear the bucket */ /* clear the bucket */
@ -111,7 +112,6 @@ MpmMatchCleanup(MpmThreadCtx *thread_ctx) {
m = nxt; m = nxt;
} }
} }
/** \brief allocate a match /** \brief allocate a match
@ -195,6 +195,8 @@ MpmMatchAppend(MpmThreadCtx *thread_ctx, PatternMatcherQueue *pmq, MpmEndMatch *
thread_ctx->qlist = m; thread_ctx->qlist = m;
} }
BUG_ON(m == m->qnext);
if (pmq != NULL) { if (pmq != NULL) {
/* make sure we only append a sig with a matching pattern once, /* make sure we only append a sig with a matching pattern once,
* so we won't inspect it more than once. For this we keep a * so we won't inspect it more than once. For this we keep a

Loading…
Cancel
Save