]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Remove BUG_ON(1) in app layer event second stage preparation function.
authorAnoop Saldanha <anoopsaldanha@gmail.com>
Sat, 11 Jan 2014 15:08:40 +0000 (20:38 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 17 Jan 2014 10:43:08 +0000 (11:43 +0100)
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
src/detect-parse.c

index 55b8a70b8069ac971bc1f94858279ec3dd0dae0e..20d925df7be5afd0a2f7abb09ac8472b827a40ac 100644 (file)
@@ -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,
index c898b49b3d9fe0eb274ba40c5175f7f198618d93..2b10ce23b62aa4ab524abd706965672ede37a054 100644 (file)
@@ -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 */