]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix using uninitialized memory (Bug #994)
authorVictor Julien <victor@inliniac.net>
Mon, 25 Nov 2013 18:38:14 +0000 (19:38 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 25 Nov 2013 18:38:14 +0000 (19:38 +0100)
src/detect-app-layer-event.c

index c469f8a7f7229f6d80677673ebdc67c3f3fc7058..c744b789df04448037f82d29e63b1351f4c5a1c3 100644 (file)
@@ -123,6 +123,7 @@ static DetectAppLayerEventData *DetectAppLayerEventParsePkt(const char *arg,
     aled = SCMalloc(sizeof(DetectAppLayerEventData));
     if (unlikely(aled == NULL))
         return NULL;
+    memset(aled,0x00,sizeof(*aled));
     aled->event_id = event_id;
     *event_type = APP_LAYER_EVENT_TYPE_PACKET;
 
@@ -168,6 +169,7 @@ static DetectAppLayerEventData *DetectAppLayerEventParseApp(const char *arg,
     aled = SCMalloc(sizeof(DetectAppLayerEventData));
     if (unlikely(aled == NULL))
         return NULL;
+    memset(aled,0x00,sizeof(*aled));
     aled->alproto = alproto;
     aled->event_id = event_id;