]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util/base64: use padding var for calculations 8214/head
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 31 Oct 2022 13:23:06 +0000 (18:53 +0530)
committerVictor Julien <vjulien@oisf.net>
Sat, 26 Nov 2022 14:09:47 +0000 (15:09 +0100)
(cherry picked from commit 58e5033a44efcb163619dc95c67021e42a2c1e66)

src/util-base64.c

index fe5ed9b800457567d15c56459ad91ca79741a6c6..531dac30445720af42d220cac28f5634103ededb 100644 (file)
@@ -157,7 +157,7 @@ Base64Ecode DecodeBase64(uint8_t *dest, uint32_t dest_size, const uint8_t *src,
 
     if (!valid && mode == BASE64_MODE_RFC4648) {
         padding = B64_BLOCK - bbidx;
-        *decoded_bytes += ASCII_BLOCK - (B64_BLOCK - bbidx);
+        *decoded_bytes += ASCII_BLOCK - padding;
         DecodeBase64Block(dptr, b64);
         *consumed_bytes += bbidx;
     }