]> granicus.if.org Git - php/commitdiff
Missing bit from previous commit
authorIlia Alshanetsky <iliaa@php.net>
Fri, 26 Nov 2010 21:00:03 +0000 (21:00 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 26 Nov 2010 21:00:03 +0000 (21:00 +0000)
ext/standard/base64.c

index 8e596b122108cb8e827f23b31dfb889449b9e0f6..192a08a43f9939e276c8d0bd061bca42f0bc37d2 100644 (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;
                        }