From: Philippe Antoine Date: Fri, 2 Dec 2022 13:43:10 +0000 (+0100) Subject: mime: do not skip empty lines for quoted-printable X-Git-Tag: suricata-7.0.0-rc1~315 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e054af1acda120a011d5d8136bc9a15cdac2f51;p=thirdparty%2Fsuricata.git mime: do not skip empty lines for quoted-printable As these lines are in the file... Ticket: #5725 --- diff --git a/src/util-decode-mime.c b/src/util-decode-mime.c index 6cf1dd5020..3da0e3186d 100644 --- a/src/util-decode-mime.c +++ b/src/util-decode-mime.c @@ -1451,6 +1451,12 @@ static int ProcessQuotedPrintableBodyLine(const uint8_t *buf, uint32_t len, SCLogDebug("Error: Max encoded input line length exceeded %u > %u", len, MAX_ENC_LINE_LEN); } + if (len == 0) { + memcpy(state->data_chunk + state->data_chunk_len, buf + len, + state->current_line_delimiter_len); + state->data_chunk_len += state->current_line_delimiter_len; + return ProcessDecodedDataChunk(state->data_chunk, state->data_chunk_len, state); + } remaining = len; offset = 0; @@ -2232,9 +2238,6 @@ static int ProcessMimeBody(const uint8_t *buf, uint32_t len, if (mdcfg->decode_base64 && (entity->ctnt_flags & CTNT_IS_BASE64)) { SCLogDebug("skip empty line"); return MIME_DEC_OK; - } else if (mdcfg->decode_quoted_printable && (entity->ctnt_flags & CTNT_IS_QP)) { - SCLogDebug("skip empty line"); - return MIME_DEC_OK; } SCLogDebug("not skipping empty line"); }