From c0d8def0e5febfa4a618f5bb56a730ffcc168e86 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 29 Sep 2017 19:10:46 +0200 Subject: [PATCH] tls: don't set event on small input data On very small data the max loop count could be 0. Make sure it's always at least 1. --- src/app-layer-ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app-layer-ssl.c b/src/app-layer-ssl.c index f6b4d23eea..1b4c0beec6 100644 --- a/src/app-layer-ssl.c +++ b/src/app-layer-ssl.c @@ -1418,7 +1418,7 @@ static int SSLDecode(Flow *f, uint8_t direction, void *alstate, AppLayerParserSt } /* if we have more than one record */ - uint32_t max_records = input_len / SSL_RECORD_MINIMUM_LENGTH; + uint32_t max_records = MAX((input_len / SSL_RECORD_MINIMUM_LENGTH),1); while (input_len > 0) { if (counter > max_records) { SCLogDebug("Looks like we have looped quite a bit. Reset state "