]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mime: do not skip empty lines for quoted-printable 8238/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 2 Dec 2022 13:43:10 +0000 (14:43 +0100)
committerVictor Julien <vjulien@oisf.net>
Sat, 3 Dec 2022 08:28:09 +0000 (09:28 +0100)
As these lines are in the file...

Ticket: #5725
(cherry picked from commit 0e054af1acda120a011d5d8136bc9a15cdac2f51)

src/util-decode-mime.c

index 6739e911fa32104159dd434590d88a005241ea01..59d0872993d04dd9cdf774588e1b8a43f42c1570 100644 (file)
@@ -1479,6 +1479,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;
@@ -2279,9 +2285,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");
             }