]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util/base64: use padding var for calculations
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 31 Oct 2022 13:23:06 +0000 (18:53 +0530)
committerVictor Julien <vjulien@oisf.net>
Thu, 10 Nov 2022 13:42:44 +0000 (15:42 +0200)
src/util-base64.c

index 93b984357002af7de4586be8f6ff8898b47ef226..7ca32cf43567ce9da8fc3ced6ab111d1dc78969e 100644 (file)
@@ -158,7 +158,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;
     }