From: Ilia Alshanetsky Date: Fri, 26 Nov 2010 21:00:03 +0000 (+0000) Subject: Missing bit from previous commit X-Git-Tag: php-5.3.4RC2~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3239a25e532eff113364eed5d597ac908a49bb22;p=php Missing bit from previous commit --- diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 8e596b1221..192a08a43f 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -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; }