]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mime: fix corner case
authorVictor Julien <vjulien@oisf.net>
Tue, 28 Jun 2022 13:29:25 +0000 (15:29 +0200)
committerVictor Julien <vjulien@oisf.net>
Wed, 29 Jun 2022 18:01:03 +0000 (20:01 +0200)
Fix a corner case where a base64 sequence including a space was followed
by a newline in the input data.

(cherry picked from commit d81582c4a2b5b9cd6000c8637a7c6bc9b8f4dfd6)

src/util-decode-mime.c

index 0e04ad8f13a756f113ff5c592e7b97093884b7e0..6a422542a773d964f703855f2e93f210bc359d3f 100644 (file)
@@ -1235,6 +1235,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 */