From 7740edae36fea4e831afc6f1e37eb559dcf597f0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 27 Oct 2014 07:45:34 +0100 Subject: Fix bug #63595 GMP memory management conflicts with other libraries using GMP Drop use of php memory allocators as this raise various conflicts with other extensions and libraries which use libgmp. No other solution found. We cannot for ensure correct use of allocator with shared lib. Some memory can allocated before php init Some memory can be freed after php shutdown Known broken run cases - php + curl + gnutls + gmp - mod_gnutls + mod_php + gnutls + gmp - php + freetds + gnutls + gmp - php + odbc + freetds + gnutls + gmp - php + php-mapi (zarafa) + gnutls + gmp --- ext/gmp/gmp.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index f51bd8c59c..b1553fa16f 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -324,30 +324,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); # define MAX_BASE 36 #endif -/* {{{ gmp_emalloc - */ -static void *gmp_emalloc(size_t size) -{ - return emalloc(size); -} -/* }}} */ - -/* {{{ gmp_erealloc - */ -static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) -{ - return erealloc(ptr, new_size); -} -/* }}} */ - -/* {{{ gmp_efree - */ -static void gmp_efree(void *ptr, size_t size) -{ - efree(ptr); -} -/* }}} */ - /* {{{ ZEND_GINIT_FUNCTION */ static ZEND_GINIT_FUNCTION(gmp) @@ -369,8 +345,6 @@ ZEND_MODULE_STARTUP_D(gmp) #endif REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT); - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - return SUCCESS; } /* }}} */ -- cgit v1.2.1 From 0ddcf2a919a24cccb36bd0a69b05e6bbfc0bf883 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Mon, 3 Nov 2014 11:43:15 -0800 Subject: update NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 8f8cd49e7a..53d047215f 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #68283 (fileinfo: out-of-bounds read in elf note headers). (CVE-2014-3710) (Remi) +- GMP: + . Fixed bug #63595 (GMP memory management conflicts with other libraries + using GMP). (Remi) + 16 Oct 2014, PHP 5.4.34 - Fileinfo: -- cgit v1.2.1