com php-src: rename publicly exposed symbol to avoid name conflicts: Zend/zend_multiply.h ext/pcre/php_pcre.c
| From: | Anatol Belski | Date: | Thu, 13 Oct 2016 13:27:58 +0000 |
| Subject: | com php-src: rename publicly exposed symbol to avoid name conflicts: Zend/zend_multiply.h ext/pcre/php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95028@lists.php.net to get a copy of this message | ||
Commit: d23ee8bf76e5031ddf0a8299ea6a96cee0a10d89
Author: Anatol Belski <ab@php.net> Thu, 13 Oct 2016 15:23:15 +0200
Parents: 56d3f5d91e2e86bb0cbcdc12a10717c633ec6fec
Branches: PHP-7.0.12
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d23ee8bf76e5031ddf0a8299ea6a96cee0a10d89
Log:
rename publicly exposed symbol to avoid name conflicts
(cherry picked from commit 730288ae41fe0d40d00b27174b558cf260b1a7df)
Changed paths:
M Zend/zend_multiply.h
M ext/pcre/php_pcre.c
Diff:
diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h
index 0c23071..8a93990 100644
--- a/Zend/zend_multiply.h
+++ b/Zend/zend_multiply.h
@@ -266,7 +266,7 @@ static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, si
}
#endif
-static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
+static zend_always_inline size_t zend_safe_address_guarded(size_t nmemb, size_t size, size_t
offset)
{
int overflow;
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 9b1fb20..31c97cf 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1248,7 +1248,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string
*su
}
if (new_len >= alloc_len) {
- alloc_len = safe_address(2, new_len, alloc_len);
+ alloc_len = zend_safe_address_guarded(2, new_len, alloc_len);
if (result == NULL) {
result = zend_string_alloc(alloc_len, 0);
} else {
@@ -1291,9 +1291,9 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string
*su
/* Use custom function to get replacement string and its length. */
eval_result = preg_do_repl_func(replace_val, subject, offsets, subpat_names, count, mark);
ZEND_ASSERT(eval_result);
- new_len = safe_address(1, ZSTR_LEN(eval_result), new_len);
+ new_len = zend_safe_address_guarded(1, ZSTR_LEN(eval_result), new_len);
if (new_len >= alloc_len) {
- alloc_len = safe_address(2, new_len, alloc_len);
+ alloc_len = zend_safe_address_guarded(2, new_len, alloc_len);
if (result == NULL) {
result = zend_string_alloc(alloc_len, 0);
} else {