From: Victor Julien Date: Sat, 4 Jun 2022 05:09:27 +0000 (+0200) Subject: base64: no special case for nul char X-Git-Tag: suricata-5.0.10~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=142514b462d7eae6b8b22831b4358a7df64e3aec;p=thirdparty%2Fsuricata.git base64: no special case for nul char Let it be handled like other invalid input. (cherry picked from commit 92cd95b4165eef540bc974d50f54a47a6b74503d) --- diff --git a/src/util-base64.c b/src/util-base64.c index 108903ecfa..5677f69b6f 100644 --- a/src/util-base64.c +++ b/src/util-base64.c @@ -100,8 +100,9 @@ Base64Ecode DecodeBase64(uint8_t *dest, uint32_t dest_size, const uint8_t *src, bool valid = true; Base64Ecode ecode = BASE64_ECODE_OK; *decoded_bytes = 0; + /* Traverse through each alpha-numeric letter in the source array */ - for (uint32_t i = 0; i < len && src[i] != 0; i++) { + for (uint32_t i = 0; i < len; i++) { /* Get decimal representation */ val = GetBase64Value(src[i]); if (val < 0) {