From d06a19301210a8296e63aeef19163b180cb8f47f Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sat, 11 Jan 2014 20:38:40 +0530 Subject: [PATCH] Remove BUG_ON(1) in app layer event second stage preparation function. This lets us single out and print rules that result in a failure, than just post a core dump. --- src/detect-app-layer-event.c | 2 +- src/detect-parse.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 55b8a70b80..20d925df7b 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -149,7 +149,7 @@ static int DetectAppLayerEventParseAppP2(DetectAppLayerEventData *data, } else if (ipproto_bitarray[IPPROTO_UDP / 8] & 1 << (IPPROTO_UDP % 8)) { ipproto = IPPROTO_UDP; } else { - BUG_ON(1); + return -1; } r = AppLayerParserGetEventInfo(ipproto, data->alproto, diff --git a/src/detect-parse.c b/src/detect-parse.c index c898b49b3d..2b10ce23b6 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1367,7 +1367,8 @@ static Signature *SigInitHelper(DetectEngineCtx *de_ctx, char *sigstr, AppLayerProtoDetectSupportedIpprotos(sig->alproto, sig->proto.proto); } - DetectAppLayerEventPrepare(sig); + if (DetectAppLayerEventPrepare(sig) < 0) + goto error; /* set mpm_content_len */ -- 2.47.3