fix: neu_decode64 on empty string

This commit is contained in:
eeff
2022-11-11 15:10:03 +08:00
parent 611f3586e9
commit 32d8271556
+4
View File
@@ -40,6 +40,10 @@ size_t calcDecodeLength(const char *b64input)
{ // Calculates the length of a decoded string
size_t len = strlen(b64input), padding = 0;
if (0 == len) {
return 0;
}
if (b64input[len - 1] == '=' &&
b64input[len - 2] == '=') // last two chars are =
padding = 2;