Skip to content

Commit

Permalink
Update util.c
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Feb 20, 2024
1 parent cb5c9b8 commit 0cc0810
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,11 @@ int SSL_base64_decode_ext(const char *in, unsigned char *out, int max_outlen, in
return 0;
}

if ((auto_padding == 1 && inlen % 4 != 0) || url_safe == 1) {
if (inlen % 4 == 0) {
auto_padding = 0;
}

if (auto_padding == 1 || url_safe == 1) {
padding_len = 4 - inlen % 4;
in_padding_data = (char *)malloc(inlen + padding_len + 1);
if (in_padding_data == NULL) {
Expand Down

0 comments on commit 0cc0810

Please sign in to comment.