From 5944d866d6bfd3c5d40f4d8b13405e3e5b17b0d0 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Tue, 13 Mar 2012 17:05:53 +0530 Subject: [PATCH 1/2] Add BUG_ON to avoid overruning AppLayerDetectDirection map array --- src/app-layer-detect-proto.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 7c158de..366a086 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++; -- 1.7.1