From 2b66667a767015986698daaec180d002b5aeae38 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 31 Dec 2009 19:10:18 +0100 Subject: [PATCH] Make sure we can't overflow our packet alert storage --- src/detect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detect.c b/src/detect.c index 365391aef1..2150ffd59e 100644 --- a/src/detect.c +++ b/src/detect.c @@ -411,7 +411,8 @@ int PacketAlertCheck(Packet *p, uint32_t sid) int PacketAlertAppend(Packet *p, uint32_t gid, uint32_t sid, uint8_t rev, uint8_t prio, char *msg, char *class_msg) { - /* XXX overflow check? */ + if (p->alerts.cnt == PACKET_ALERT_MAX) + return 0; SCLogDebug("sid %"PRIu32"", sid);