diff --git a/baselib/utils/src/utils_base64.c b/baselib/utils/src/utils_base64.c index 12768b61119e45cca9904849e9ca12804cff5899..6a1d750a2b46f6f421a5b33eea33b60ed3471468 100644 --- a/baselib/utils/src/utils_base64.c +++ b/baselib/utils/src/utils_base64.c @@ -92,7 +92,7 @@ static int32_t Base64Encode(const uint8_t *from, uint32_t fromLen, uint8_t *to, if (padding-- > 0 && toLen >= 1) { to[toLen - 1] = '='; /* padding the -1 to "=" */ } - if (padding-- > 0 && toLen >= 2) { + if (padding-- > 0 && toLen >= 2) { /* toLen need to be larger than 2 */ to[toLen - 2] = '='; /* padding the -2 to "=" */ }