diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 6190938285..d3d0c5531c 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -1244,7 +1244,9 @@ int PatternMatchPrepareGroup(DetectEngineCtx *de_ctx, SigGroupHead *sh) if (mpm_store != NULL) { sh->init->app_mpms[a->id] = mpm_store->mpm_ctx; - if (a->PrefilterRegister) { + /* if we have just certain types of negated patterns, + * mpm_ctx can be NULL */ + if (a->PrefilterRegister && mpm_store->mpm_ctx) { BUG_ON(a->PrefilterRegister(sh, mpm_store->mpm_ctx) != 0); } }