]> granicus.if.org Git - php/commitdiff
@- Fixed possible buffer-overflow in base64_decode. (Thies)
authorThies C. Arntzen <thies@php.net>
Sun, 6 Feb 2000 15:18:59 +0000 (15:18 +0000)
committerThies C. Arntzen <thies@php.net>
Sun, 6 Feb 2000 15:18:59 +0000 (15:18 +0000)
fix #3226

ext/standard/base64.c

index 521ccccbf9ad9b8211d262541e8e7666e983484f..0e0192ca16f8fe6c156041cb84216749e38ac9e2 100644 (file)
@@ -88,7 +88,7 @@ unsigned char *php_base64_decode(const unsigned char *string, int length, int *r
                }
        }
 
-       result = (unsigned char *)emalloc((length / 4 * 3 + 1) * sizeof(char));
+       result = (unsigned char *)emalloc(length + 1);
        if (result == NULL) {
                return NULL;
        }