]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Add BUG_ON to avoid overruning AppLayerDetectDirection map array
authorAnoop Saldanha <poonaatsoc@gmail.com>
Tue, 13 Mar 2012 11:35:53 +0000 (17:05 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 19 Mar 2012 10:30:23 +0000 (11:30 +0100)
src/app-layer-detect-proto.c

index 7c158de927b66190f681e23610d4970024e3f863..366a08678926f5325ce88a998e402c1976871e19 100644 (file)
@@ -226,6 +226,7 @@ void AlpProtoAdd(AlpProtoDetectCtx *ctx, uint16_t ip_proto, uint16_t al_proto, c
 
     mpm_table[dir->mpm_ctx.mpm_type].AddPattern(&dir->mpm_ctx, cd->content, cd->content_len,
                                 cd->offset, cd->depth, cd->id, cd->id, 0);
+    BUG_ON(dir->id == ALP_DETECT_MAX);
     dir->map[dir->id] = al_proto;
     dir->id++;