Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/standard/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length,
result = (unsigned char *)safe_emalloc(length, 1, 1);

/* run through the whole string, converting as we go */
while ((ch = *current++) != '\0' && length-- > 0) {
while (length-- > 0) {
ch = *current++;
if (ch == base64_pad) {
if (*current != '=' && ((i % 4) == 1 || (strict && length > 0))) {
if ((i % 4) != 1) {
Expand Down