diff options
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 9225c0f976..a08770bd88 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); |