Missing bit from previous commit

This commit is contained in:
Ilia Alshanetsky 2010-11-26 21:00:03 +00:00
parent f28cff1925
commit 3239a25e53

View File

@ -152,7 +152,7 @@ PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length,
/* run through the whole string, converting as we go */
while ((ch = *current++) != '\0' && length-- > 0) {
if (ch == base64_pad) {
if (*current != '=' && (i % 4) == 1) {
if (*current != '=' && ((i % 4) == 1 || (strict && length > 0))) {
efree(result);
return NULL;
}