From 7e4df3a1d17ad7d7279601a395b2e9329ad8ee43 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 30 Sep 2016 12:33:49 +0200 Subject: [PATCH] tls-validity: fix memory handling --- src/detect-tls-cert-validity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/detect-tls-cert-validity.c b/src/detect-tls-cert-validity.c index 09bb60eb6a..1da3270324 100644 --- a/src/detect-tls-cert-validity.c +++ b/src/detect-tls-cert-validity.c @@ -418,7 +418,7 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s, SCLogDebug("\'%s\'", rawstr); - dd = SCMalloc(sizeof(DetectTlsValidityData)); + dd = SCCalloc(1, sizeof(DetectTlsValidityData)); if (dd == NULL) { SCLogError(SC_ERR_INVALID_ARGUMENT,"Allocation \'%s\' failed", rawstr); goto error; @@ -436,7 +436,7 @@ static int DetectTlsExpiredSetup (DetectEngineCtx *de_ctx, Signature *s, goto error; } - dd->mode |= DETECT_TLS_VALIDITY_EX; + dd->mode = DETECT_TLS_VALIDITY_EX; dd->type = DETECT_TLS_TYPE_NOTAFTER; dd->epoch = 0; dd->epoch2 = 0; @@ -476,7 +476,7 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s, SCLogDebug("\'%s\'", rawstr); - dd = SCMalloc(sizeof(DetectTlsValidityData)); + dd = SCCalloc(1, sizeof(DetectTlsValidityData)); if (dd == NULL) { SCLogError(SC_ERR_INVALID_ARGUMENT,"Allocation \'%s\' failed", rawstr); goto error; @@ -494,7 +494,7 @@ static int DetectTlsValidSetup (DetectEngineCtx *de_ctx, Signature *s, goto error; } - dd->mode |= DETECT_TLS_VALIDITY_VA; + dd->mode = DETECT_TLS_VALIDITY_VA; dd->type = DETECT_TLS_TYPE_NOTAFTER; dd->epoch = 0; dd->epoch2 = 0;