Browse Source

Merge branch 'PHP-7.0'

* PHP-7.0:
  Fixed bug #72463 mail fails with invalid argument
pull/1955/head
Anatol Belski 10 years ago
parent
commit
d20372cf6c
  1. 2
      ext/pcre/php_pcre.c
  2. 12
      ext/pcre/tests/bug72463.phpt

2
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);

12
ext/pcre/tests/bug72463.phpt

@ -0,0 +1,12 @@
--TEST--
Bug #72463 mail fails with invalid argument
--FILE--
<?php
@mail("some.address.it.wont.ever.reach@lookup.and.try.to.find.this.host.name","subject","a", "");
@mail("some.address.it.wont.ever.reach@lookup.and.try.to.find.this.host.name","subject","a", NULL);
?>
===DONE===
--EXPECTF--
===DONE===
Loading…
Cancel
Save