From: Shivani Bhardwaj Date: Tue, 4 Apr 2023 06:13:21 +0000 (+0530) Subject: util/mime: allow delim len 0 when line limit is hit X-Git-Tag: suricata-6.0.11~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=564c7793a5c032fe5a2b49c235d15573d4384837;p=thirdparty%2Fsuricata.git util/mime: allow delim len 0 when line limit is hit (cherry picked from commit fd4e0fbafedd23bc4a0f6ab874e20f73cb40d1e0) --- diff --git a/src/util-decode-mime.c b/src/util-decode-mime.c index 789918bde3..a3001d651f 100644 --- a/src/util-decode-mime.c +++ b/src/util-decode-mime.c @@ -24,7 +24,7 @@ */ #include "suricata-common.h" - +#include "app-layer-smtp.h" #include "util-decode-mime.h" #include "util-ip.h" #include "util-spm-bs.h" @@ -1712,7 +1712,7 @@ static int FindMimeHeader(const uint8_t *buf, uint32_t blen, MimeDecConfig *mdcfg = MimeDecGetConfig(); /* should not get here with incomplete lines */ - DEBUG_VALIDATE_BUG_ON(state->current_line_delimiter_len == 0); + DEBUG_VALIDATE_BUG_ON(state->current_line_delimiter_len == 0 && blen < SMTP_LINE_BUFFER_LIMIT); /* Find first header */ hname = FindMimeHeaderStart(buf, blen, &hlen);