mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
1.0 KiB

diff -Nura php-5.1.6.orig/Zend/zend_alloc.c php-5.1.6/Zend/zend_alloc.c
--- ./Zend/zend_alloc.c 2006-08-10 19:16:24.000000000 +0200
+++ ./Zend/zend_alloc.c 2006-10-09 09:36:32.000000000 +0200
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.144.2.4 2006/08/10 17:16:24 iliaa Exp $ */
+/* $Id: zend_alloc.c,v 1.144.2.5 2006/09/30 17:15:23 iliaa Exp $ */
#include "zend.h"
#include "zend_alloc.h"
@@ -328,15 +328,14 @@
ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
void *p;
- int final_size = size*nmemb;
-
+
HANDLE_BLOCK_INTERRUPTIONS();
- p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
+ p = _safe_emalloc(nmemb, size, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
if (!p) {
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *) p;
}
- memset(p, 0, final_size);
+ memset(p, 0, size * nmemb);
HANDLE_UNBLOCK_INTERRUPTIONS();
return p;
}