From: Anoop Saldanha Date: Sat, 11 Jan 2014 15:08:40 +0000 (+0530) Subject: Remove BUG_ON(1) in app layer event second stage preparation function. X-Git-Tag: suricata-2.0rc1~192 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d06a19301210a8296e63aeef19163b180cb8f47f;p=thirdparty%2Fsuricata.git 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. --- 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 */