]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect: fix error handling in mpm setup
authorVictor Julien <victor@inliniac.net>
Tue, 5 Apr 2016 11:14:03 +0000 (13:14 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Apr 2016 11:14:03 +0000 (13:14 +0200)
commitd085362e610f1a64e08132d40890c791757c28e5
treea17702f7bd2b50474c4aea585c9d6d19f28d29ff
parentdc008206e346ea339af8a2e3c600eafe98ac187f
detect: fix error handling in mpm setup

*** CID 1358124:  Null pointer dereferences  (REVERSE_INULL)
/src/detect-engine-mpm.c: 940 in MpmStoreSetup()
934                     PopulateMpmHelperAddPatternToPktCtx(ms->mpm_ctx,
935                             cd, s, 0, (cd->flags & DETECT_CONTENT_FAST_PATTERN_CHOP));
936                 }
937             }
938         }
939
>>>     CID 1358124:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "ms->mpm_ctx" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
940         if (ms->mpm_ctx != NULL) {
941             if (ms->mpm_ctx->pattern_cnt == 0) {
942                 MpmFactoryReClaimMpmCtx(de_ctx, ms->mpm_ctx);
943                 ms->mpm_ctx = NULL;
944             } else {
945                 if (ms->sgh_mpm_context == MPM_CTX_FACTORY_UNIQUE_CONTEXT) {
src/detect-engine-mpm.c