From: Victor Julien Date: Tue, 28 Jun 2022 13:29:25 +0000 (+0200) Subject: mime: fix corner case X-Git-Tag: suricata-7.0.0-beta1~414 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d81582c4a2b5b9cd6000c8637a7c6bc9b8f4dfd6;p=thirdparty%2Fsuricata.git mime: fix corner case Fix a corner case where a base64 sequence including a space was followed by a newline in the input data. --- diff --git a/src/util-decode-mime.c b/src/util-decode-mime.c index 9c6a1103c3..2be9852c04 100644 --- a/src/util-decode-mime.c +++ b/src/util-decode-mime.c @@ -1226,6 +1226,9 @@ static uint8_t ProcessBase64Remainder( memcpy(state->bvremain, block, cnt); } state->bvr_len = cnt; + } else if (!force && cnt != B64_BLOCK) { + SCLogDebug("incomplete data and no buffer to backfill"); + return 0; } /* in force mode pad the block */