]> granicus.if.org Git - php/commitdiff
- calloc must actually clearing the requested size (Andrei)
authorPierre Joye <pajoye@php.net>
Sun, 28 Jun 2009 09:47:42 +0000 (09:47 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 28 Jun 2009 09:47:42 +0000 (09:47 +0000)
Zend/zend_alloc.h

index 3bd75314a9b0eaf7b65e48aa939c185f6fba6bb9..679e0e52e15d14d3bc64a3492e0babf2dc0bdba0 100644 (file)
@@ -89,7 +89,7 @@ inline static void * __zend_malloc(size_t len)
 inline static void * __zend_calloc(size_t nmemb, size_t len)
 {
        void *tmp = _safe_malloc(nmemb, len, 0);
-       memset(tmp, 0, len);
+       memset(tmp, 0, nmemb * len);
        return tmp;
 }