Skip to content

Commit 542d0bc

Browse files
committed
ext/sodium: Correct base64 decoding with unpadded variants
Backports 0eee0b957a3b75f8175cdd30b306c15e372685e8 from the PECL extension
1 parent 5af5f56 commit 542d0bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/sodium/libsodium.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ PHP_FUNCTION(sodium_base642bin)
27802780
"invalid base64 variant identifier", 0);
27812781
return;
27822782
}
2783-
bin_len = b64_len / 4U * 3U + 1U;
2783+
bin_len = b64_len / 4U * 3U + 2U;
27842784
bin = zend_string_alloc(bin_len, 0);
27852785
if (sodium_base642bin((unsigned char *) ZSTR_VAL(bin), bin_len,
27862786
b64, b64_len,

0 commit comments

Comments
 (0)