From e4539042516f337435c07a6e207eb5178e199d9a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 22 Jun 2016 19:05:31 +0200 Subject: Fixed bug #72463 mail fails with invalid argument --- ext/pcre/php_pcre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index ed0f3b3ac4..356b5dc95a 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1331,7 +1331,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su break; } new_len = result_len + subject_len - start_offset; - if (new_len > alloc_len) { + if (new_len >= alloc_len) { alloc_len = new_len; /* now we know exactly how long it is */ if (NULL != result) { result = zend_string_realloc(result, alloc_len, 0); -- cgit v1.2.1 From bd74e7d0133493ee4290857ac368f5fbdd278084 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 23 Jun 2016 14:06:48 +0800 Subject: Fixed bug #72476 (Memleak in jit_stack) --- ext/pcre/php_pcre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 356b5dc95a..3d59b77005 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -216,7 +216,7 @@ static PHP_MSHUTDOWN_FUNCTION(pcre) /* {{{ PHP_RINIT_FUNCTION(pcre) */ static PHP_RINIT_FUNCTION(pcre) { - if (PCRE_G(jit)) { + if (PCRE_G(jit) && jit_stack == NULL) { jit_stack = pcre_jit_stack_alloc(PCRE_JIT_STACK_MIN_SIZE,PCRE_JIT_STACK_MAX_SIZE); } -- cgit v1.2.1