]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util: fix integer warnings in mime decoding
authorPhilippe Antoine <pantoine@oisf.net>
Wed, 8 Jun 2022 15:07:45 +0000 (17:07 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 9 Jun 2022 05:27:16 +0000 (07:27 +0200)
Ticket: #4516

src/util-decode-mime.c

index deb91515d9797a220a551cf7d27962f29e930d9f..80fd9d9da6c417f1f61ab641da991f9adb336f8f 100644 (file)
@@ -1224,7 +1224,7 @@ static uint8_t ProcessBase64Remainder(
         const uint8_t *buf, const uint32_t len, MimeDecParseState *state, int force)
 {
     uint8_t buf_consumed = 0; /* consumed bytes from 'buf' */
-    uint32_t cnt = 0;
+    uint8_t cnt = 0;
     uint8_t block[B64_BLOCK];
 
     /* should be impossible, but lets be defensive */
@@ -1345,7 +1345,7 @@ static int ProcessBase64BodyLine(const uint8_t *buf, uint32_t len,
         uint32_t left = len - consumed;
         if (left < B64_BLOCK) {
             memcpy(state->bvremain, buf + consumed, left);
-            state->bvr_len = left;
+            state->bvr_len = (uint8_t)left;
             return MIME_DEC_OK;
         }
         remaining -= consumed;
@@ -1408,7 +1408,7 @@ static int ProcessBase64BodyLine(const uint8_t *buf, uint32_t len,
             /* If remaining is 4 by this time, we encountered spaces during processing */
             DEBUG_VALIDATE_BUG_ON(state->bvr_len != 0);
             memcpy(state->bvremain, buf + offset + consumed_bytes, leftover_bytes);
-            state->bvr_len = leftover_bytes;
+            state->bvr_len = (uint8_t)leftover_bytes;
             return MIME_DEC_OK;
         }