From: Anoop Saldanha Date: Tue, 13 Mar 2012 11:35:53 +0000 (+0530) Subject: Add BUG_ON to avoid overruning AppLayerDetectDirection map array X-Git-Tag: suricata-1.3beta1~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7511fa67cd57a6add93dcbf89e101fb0f7ad0ce7;p=thirdparty%2Fsuricata.git Add BUG_ON to avoid overruning AppLayerDetectDirection map array --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 7c158de927..366a086789 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -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++;