]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util/mime: use uint8_t for cnt
authorShivani Bhardwaj <shivani@oisf.net>
Wed, 15 Mar 2023 06:26:18 +0000 (11:56 +0530)
committerVictor Julien <vjulien@oisf.net>
Tue, 28 Mar 2023 09:35:36 +0000 (11:35 +0200)
cnt should not exceed B64_BLOCK which is 4, so, it is unnecessary to use
uint32_t for the variable.

src/util-decode-mime.c

index 8e3b4b0e46c37c4621db7c5a80c7c0b61c3d5e66..789918bde32b89ff126a6b551f8e62e33687c4d2 100644 (file)
@@ -1203,7 +1203,7 @@ static uint32_t ProcessBase64Remainder(
         const uint8_t *buf, const uint32_t len, MimeDecParseState *state, int force)
 {
     uint32_t buf_consumed = 0; /* consumed bytes from 'buf' */
-    uint32_t cnt = 0;
+    uint8_t cnt = 0;
     uint8_t block[B64_BLOCK];
 
     SCLogDebug("len %u force %d", len, force);