]> 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 07:38:22 +0000 (09:38 +0200)
Fix a corner case where a base64 sequence including a space was followed
by a newline in the input data.

src/util-decode-mime.c

index 9c6a1103c302e34d67fe007e5077484d9474ae44..2be9852c04c96447f51909e1e96e05f48bea84ed 100644 (file)
@@ -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 */