Compare commits

..
1449 Commits
Author SHA1 Message Date
Anatol Belski 94933677a3 fix indent 2016-12-06 16:27:12 +01:00
Anatol Belski 6544955bbc update NEWS 2016-12-06 16:26:38 +01:00
Anatol Belski 7f22627870 fix leak, take on 7.x
(cherry picked from commit 9b1430140a)
2016-12-06 16:24:12 +01:00
Stanislav Malyshev 7eb7831295 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  This still leaks memory, I don't have enough knowledge in WDDX code to fix them :(

(cherry picked from commit 183b4d78aa)
2016-12-06 16:23:43 +01:00
Stanislav Malyshev a5c493c339 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #73631 - Invalid read when wddx decodes empty boolean element

(cherry picked from commit 6292fe84d3)
2016-12-06 16:22:52 +01:00
Anatol Belski 254d5017c6 set versions 2016-12-06 09:54:00 +01:00
Anatol Belski 90d0bda0be update NEWS 2016-12-06 09:44:32 +01:00
Stanislav Malyshev 52f1cabf34 Fix int/size_t confusion in isValidPharFilename (bug #73580)
(cherry picked from commit bcc913fa8b)
2016-12-06 09:42:04 +01:00
Anatol Belski 77e313848a update NEWS 2016-12-06 09:41:05 +01:00
Stanislav Malyshev a92718868d Fix bug #73645 - int/size_t confusion
(cherry picked from commit 1d59ed7524)
2016-12-06 09:34:40 +01:00
Anatol Belski a64fff6d4e fix version in NEWS 2016-11-22 13:26:10 +01:00
Anatol Belski 3ded4b718d update libs_versions.txt
(cherry picked from commit 13c45021dc)
2016-11-22 13:05:41 +01:00
Anatol Belski 83efec88f7 set versions 2016-11-22 12:00:28 +01:00
Dmitry Stogov 0cf69234e9 Fixed use after free 2016-11-22 13:28:27 +03:00
Dmitry Stogov 63ea4d194b Fixed memory leak (Bob) 2016-11-22 11:22:10 +03:00
Anatol Belski 0da08fe595 Revert "fix invalid read, follow up on 97b65cc9"
This reverts commit b52fa5882a.
2016-11-22 02:52:23 +01:00
Anatol Belski b52fa5882a fix invalid read, follow up on 97b65cc9 2016-11-22 02:28:45 +01:00
Anatol Belski d30b73a7d4 update NEWS 2016-11-22 00:59:40 +01:00
Anatol Belski 8c0227745b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-11-22 00:59:07 +01:00
Anatol Belski 0796db97d4 update NEWS 2016-11-22 00:57:18 +01:00
Anatol Belski 58aa1a70a0 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #73498
  Add a test for bug 73498
2016-11-22 00:46:03 +01:00
Craig Duncan 644e290fcd Fix bug #73498
Postgres uses the DELIMITER keyword since 7.3
And WITH is no longer required/used
2016-11-22 00:42:45 +01:00
Craig Duncan d36d4c70d3 Add a test for bug 73498 2016-11-22 00:42:45 +01:00
Anatol Belski 5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Anatol Belski 914ff56cff update php.ini-* for bug #69090 2016-11-21 22:58:23 +01:00
Anatol Belski d83ed9b588 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update php.ini-* according to changes for bug #69090
2016-11-21 22:56:46 +01:00
Anatol Belski 850c1095ab update php.ini-* according to changes for bug #69090 2016-11-21 22:52:03 +01:00
Anatol Belski 35993dbb6f update NEWS 2016-11-21 19:59:30 +01:00
Anatol Belski 0df6a32a35 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-11-21 19:58:54 +01:00
Anatol Belski 1d352645fc update NEWS 2016-11-21 19:56:09 +01:00
Anatol Belski eb53865dfd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test for bug #73452
  Backport 15ac4904 to 5.6
2016-11-21 15:29:44 +01:00
Anatol Belski 4805be1db6 add test for bug #73452 2016-11-21 15:25:46 +01:00
Anatol Belski 0da5cb5fb6 Backport 15ac4904 to 5.6 2016-11-21 15:20:03 +01:00
Xinchen Hui a39d2f8ea1 Update NEWS 2016-11-21 11:45:49 +08:00
Tyson Andre cdb7aafc23 Fix memory leak(null coalescing operator with Spl hash)
The SEPARATE_ARG_IF_REF macro increased the refcount of the object passed as a
key.
However, when the key did not exist in the ArrayAccess implementation,
the code returned early without trying to decrement the refcount.

Add a test of `??` succeeding+failing on a SplObjectStorage instance.
2016-11-20 15:46:13 -08:00
Jakub Zelenka 60574ea1ac Fix bug #73526 (php_json_encode depth issue) 2016-11-20 20:36:03 +00:00
Craig Duncan 685b1292e9 Fix bug #73538
Remove any previous default headers and replace with the specified
ones, as documented, and as is the case when a single header is
passed.
2016-11-20 21:18:28 +01:00
Bob Weinand bc30206b8a Revert "Revert "Remove a few unused write warning""
This reverts commit ff5a65d26b.

(With zend_ prefix now)
2016-11-20 19:18:50 +01:00
Nikita Popov ff5a65d26b Revert "Remove a few unused write warning (backport from master, oops)s"
This reverts commit c65d24eaa3.
2016-11-20 19:09:05 +01:00
Bob Weinand c65d24eaa3 Remove a few unused write warning (backport from master, oops)s 2016-11-20 14:17:14 +01:00
Xinchen Hui ebfd93f725 Fixed bug #73483 (Segmentation fault on pcre_replace_callback) 2016-11-20 15:44:27 +08:00
Joe Watkins 274951a4a2 Fix #73219 (fix acinclude when / is present) 2016-11-20 05:34:08 +00:00
Joe Watkins 7753d10457 make it possible to show specific help pages without interactive session 2016-11-20 05:24:14 +00:00
Anatol Belski 48191010d5 fix test portability 2016-11-18 22:10:41 +01:00
Anatol Belski 5b9d7160c5 don't fail miserably, when an unknown vc version is used 2016-11-18 18:19:47 +01:00
Nikita Popov c0b0e1b0c7 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-18 17:56:16 +01:00
Mitch Hagstrand 55980684f6 Fix the lchwon error test for Travis CI.
The E_WARNING message from the PHP function lchown is passed
from the system function lchown. The error message returned
from lchown can be filesystem dependent.
2016-11-18 17:55:44 +01:00
Christoph M. Becker 583a273849 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-18 14:29:52 +01:00
Dmitry Stogov 74b3e809d9 Regenerated scanner 2016-11-18 16:19:46 +03:00
Dmitry Stogov 97b65cc9c2 Fixed memory leaks in parse_ini_file() 2016-11-18 16:17:52 +03:00
Christoph M. Becker e44deba1e9 Fix #64526: Add missing mysqlnd.* parameters to php.ini-* 2016-11-18 14:17:19 +01:00
Dmitry Stogov 0c78fe4bb5 Disabled PHP call tracing by default (it makes significant overhead).
This may be enabled again using envirionment variable USE_ZEND_DTRACE=1.
2016-11-18 13:19:30 +03:00
Anatol Belski 5008acd1f6 add vc15 to the list 2016-11-17 23:43:32 +01:00
Dmitry Stogov 3817a2e6d5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test
  Updated NEWS
  Improvement for bug73297
  Simplify ext/standard/tests/http/bug73297.phpt
  http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses
  Add failing test for bug#73297
2016-11-17 15:58:38 +03:00
Dmitry Stogov c2d6ffb85f Fixed test 2016-11-17 15:57:40 +03:00
Dmitry Stogov 05d382e7ec Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:php-src:
  Updated NEWS
  Improvement for bug73297
  Simplify ext/standard/tests/http/bug73297.phpt
  http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses
  Add failing test for bug#73297
2016-11-17 14:07:11 +03:00
Dmitry Stogov c2173c16d0 Fixed 64-bit build 2016-11-17 14:05:22 +03:00
Julien Pauli 0e03003db2 Updated NEWS 2016-11-17 11:51:53 +01:00
Julien Pauli 4b2cbc3f2f Improvement for bug73297 2016-11-17 11:51:53 +01:00
Rowan Collins 66ac73bee8 Simplify ext/standard/tests/http/bug73297.phpt 2016-11-17 11:51:53 +01:00
Rowan Collins 94374c51e7 http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses 2016-11-17 11:51:53 +01:00
Rowan Collins 4683377dfa Add failing test for bug#73297 2016-11-17 11:51:53 +01:00
Julien Pauli c4f1c20d80 Updated NEWS 2016-11-17 11:37:13 +01:00
Julien Pauli 49030f2a25 Improvement for bug73297 2016-11-17 11:33:36 +01:00
Dmitry Stogov a67637039f Prevent modification of immutable arrays (ext/mbstring/tests/bug26639.phpt failure with opcache.protect_memory=1) 2016-11-17 13:33:05 +03:00
Dmitry Stogov d4b3f89c53 Overflow check 2016-11-17 13:17:34 +03:00
Rowan Collins eba5e276c7 Simplify ext/standard/tests/http/bug73297.phpt 2016-11-17 11:04:57 +01:00
Rowan Collins aec1a5eccc http_fopen_wrapper.c - bug#73297 Skip past "100 Continue" responses 2016-11-17 11:04:56 +01:00
Rowan Collins 6122526cea Add failing test for bug#73297 2016-11-17 11:04:56 +01:00
Dmitry Stogov 5e001c34ec Skip 64-bit specific tests on 32-bit systems 2016-11-17 11:44:28 +03:00
Dmitry Stogov 27542d9c9d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Accorate handling of too big inodes of chroot directories
2016-11-17 01:14:23 +03:00
Dmitry Stogov 9849c97b1b Accorate handling of too big inodes of chroot directories 2016-11-17 01:08:42 +03:00
Mitch Hagstrand 1d8be7c044 Fix #73546: Logging for opcache has an empty file name 2016-11-16 21:30:40 +01:00
Dmitry Stogov 71ee641327 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  "opcache.validate_root" is useless on Windows
2016-11-16 23:19:56 +03:00
Dmitry Stogov 935d922114 "opcache.validate_root" is useless on Windows 2016-11-16 23:15:14 +03:00
Dmitry Stogov 8e350a627a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Use full path
2016-11-16 23:05:00 +03:00
Dmitry Stogov 8202b97077 Use full path 2016-11-16 23:01:40 +03:00
Dmitry Stogov 99e5d6c4a5 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:php-src:
2016-11-16 16:47:05 +03:00
Dmitry Stogov eb976b89c4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed ZTS build
  Fix #73530: Unsetting result set may reset other result set
2016-11-16 16:46:54 +03:00
Dmitry Stogov a91f3d475e Fixed ZTS build 2016-11-16 16:43:57 +03:00
Christoph M. Becker 936cafe33e Merge branch 'PHP-5.6' into PHP-7.0 2016-11-16 12:00:39 +01:00
Christoph M. Becker eb570294a2 Fix #73530: Unsetting result set may reset other result set
Calling sqlite3_reset() when a result set object is freed can cause
undesired and maybe even hard to track interference with other result
sets. Furthermore, there is no need to call sqlite3_reset(), because
that is implicitly called on SQLite3Stmt::execute(), and users are
encouraged to explicitly call either SQLite3Result::finalize() or
SQLite3Stmt::reset() anyway.
2016-11-16 11:49:04 +01:00
Dmitry Stogov a1a5b52f3b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #69090 (check cached files permissions)
2016-11-16 12:49:50 +03:00
Dmitry Stogov ecba563f2f Fixed bug #69090 (check cached files permissions) 2016-11-16 12:43:10 +03:00
Bob Weinand 22a43551a2 Fix passing of wrong values in bp export 2016-11-13 18:30:23 +01:00
Bob Weinand ba75d4c50b Properly escape all filenames when exporting breakpoints 2016-11-13 13:22:06 +01:00
Mitch Hagstrand 57c0773cd7 Fix phpdbg breakpoint restoring after execution completes 2016-11-13 12:44:25 +01:00
Joe Watkins 84e2904def news entry for #1787 2016-11-13 05:33:59 +00:00
jhdxr 0bd63959c9 move declaration of vars to top 2016-11-13 05:32:24 +00:00
jhdxr 9ad2083773 add test for #69587 2016-11-13 05:32:24 +00:00
jhdxr 23f9e48273 fix bug #69587 DateInterval properties and isset 2016-11-13 05:32:24 +00:00
Joe Watkins beed682572 news entry for #2166 2016-11-12 17:45:16 +00:00
Edgar R. Sandi 72be8de39f fixed bug generated by fixes bug #73135 2016-11-12 17:43:16 +00:00
Edgar R. Sandi 1631c61feb phpt file to bug #73135 2016-11-12 17:43:16 +00:00
Edgar R. Sandi 319822b050 fixes bug #73135 2016-11-12 17:43:16 +00:00
Joe Watkins d2b03119e2 news entry for calendar overflow fix 2016-11-12 17:35:04 +00:00
Joshua Rogers 1b8cfaf23d Fix integer overflow in calender.
Fix int overflows in conversation functions for calendar.
Add tests for the overflows.
2016-11-12 17:33:51 +00:00
Jean Carlo Machado f578ce3a13 added a test for date_interval_format function 2016-11-12 09:57:50 +00:00
Joe Watkins ff1986e4d7 Merge branch 'pull-request/2198' 2016-11-12 08:16:01 +00:00
Stricted 81fed37784 fix erroneous line in confutils.js 2016-11-12 02:35:41 +01:00
Nikita Popov bb3d0c0e17 Fcall optimization: Avoid FETCH_DIM_R with UNUSED op2 2016-11-10 21:36:46 +01:00
Dmitry Stogov 15ac490472 Don't update proprties inplace. 2016-11-10 12:32:07 +03:00
Anatol Belski f6be108574 add missing NEWS entry 2016-11-09 21:34:41 +01:00
Anatol Belski cc1337bced Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add missing NEWS entry
2016-11-09 21:34:16 +01:00
Anatol Belski e922d89f66 add missing NEWS entry 2016-11-09 21:32:44 +01:00
Anatol Belski 1beb5a74b1 sync NEWS 2016-11-09 11:19:13 +01:00
Ferenc Kovacs 723c7c6466 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-09 02:16:32 +01:00
Ferenc Kovacs 87673d6e99 add missing NEWS entries 2016-11-09 02:12:16 +01:00
Anatol Belski e87daf363b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix memory leak
2016-11-08 12:16:39 +01:00
Anatol Belski d6d08f97cd fix memory leak 2016-11-08 12:12:58 +01:00
Anatol Belski 2b30b54275 Merge remote-tracking branch 'phpsec/PHP-7.0.13' into PHP-7.0
* phpsec/PHP-7.0.13:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  remove unreferenced var came in with merge
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
  fix version
  set versions
2016-11-08 11:13:29 +01:00
Anatol Belski 5faaf76bd5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
  Fix #72696: imagefilltoborder stackoverflow on truecolor images
  Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
  Fix bug #73144 and bug #73341 - remove extra dtor
  Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
2016-11-08 11:11:22 +01:00
Anatol Belski 33766347cb Merge remote-tracking branch 'phpsec/PHP-5.6.28' into PHP-5.6 2016-11-08 11:06:52 +01:00
Anatol Belski ef55a4b5b3 Enable FTS4 and FTS5 for bundled libsqlite
FTS3 is already enabled by default, and the other FTS versions
seems just to have been missed. Given that, the other FTS plugins
look like a low impact so worth a try. The current bundled libsqlite
versions in 7.x are proven stable already and support FTS5.
2016-11-08 02:26:43 +01:00
Anatol Belski 0c2156d190 avoid unneeded copying 2016-11-07 21:09:03 +01:00
Anatol Belski a67b894cc8 update NEWS 2016-11-07 20:47:06 +01:00
Anatol Belski f0676cbe20 Add test for bug #73448 2016-11-07 20:39:51 +01:00
Anatol Belski 3558e70e58 Fixed bug #73448 odbc_errormsg returns trash, always 513 bytes 2016-11-07 20:18:29 +01:00
Jakub Zelenka 20587805f9 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-06 20:43:50 +00:00
Jakub Zelenka 493b2bff02 Fix bug #72776 (Invalid parameter in memcpy function trough openssl_pbkdf2) 2016-11-06 20:40:51 +00:00
Anatol Belski 8d1376ee4f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add missing RETURN_STRINGL_CHECK
2016-11-06 17:56:14 +01:00
Anatol Belski b044a7429e add missing RETURN_STRINGL_CHECK
As RETVAL_STRINGL_CHECK is already there, this one is needed for
completion. One place in ext/bz2 is missing that, so it will likely
be useful for other possible fixes.
2016-11-06 17:51:25 +01:00
Anatol Belski b9200b4623 update NEWS 2016-11-06 17:11:19 +01:00
Nikita Popov b2af4e8868 Complete the fix of bug #70172 for PHP 7 2016-11-05 23:06:27 +01:00
Dorin Marcoci 3d73f718b2 Fix blob parameters binding. Fixes: #73087, #61183, #71494
Adjusted formatting according to requirements

Test case for bug #73087
2016-11-05 22:49:16 +01:00
Stanislav Malyshev 3b78cabc88 More int->size_t and string overflow fixes 2016-11-05 14:00:47 -07:00
Anatol Belski cf4f168d4c rename the tmp ini file, to keep it consistent with m4 variant 2016-11-04 18:42:36 +01:00
Anatol Belski 3ec398f650 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix dir separator in test
2016-11-04 18:38:22 +01:00
Anatol Belski 617f38b0e0 fix dir separator in test 2016-11-04 18:29:54 +01:00
Anatol Belski a61eade827 fix dir separator 2016-11-04 13:10:52 +01:00
Stanislav Malyshev d858b4c77f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add length check for bzcompress too - fix for bug #73356
2016-11-03 22:30:46 -07:00
Stanislav Malyshev 40f7fea897 Add length check for bzcompress too - fix for bug #73356 2016-11-03 22:10:22 -07:00
Stanislav Malyshev 2fa455128c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  More string length checks & fixes
2016-11-03 22:05:25 -07:00
Stanislav Malyshev 1fd18821e0 More string length checks & fixes 2016-11-03 21:35:09 -07:00
Stanislav Malyshev 6e12e49b5b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  More string length checks & fixes
2016-11-03 20:46:25 -07:00
Stanislav Malyshev ea9fac94bb More string length checks & fixes 2016-11-03 20:36:52 -07:00
Derick Rethans 7f2b7a4950 Updated to version 2016.9 (2016i) 2016-11-03 13:57:31 -04:00
Derick Rethans 209202e4b5 Empty merge 2016-11-03 13:57:30 -04:00
Derick Rethans ccb91cde94 Updated to version 2016.9 (2016i) 2016-11-03 13:57:28 -04:00
Anatol Belski de643586de Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash
(cherry picked from commit 99b242a6d0)
2016-11-03 17:09:03 +01:00
Anatol Belski 99b242a6d0 Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crash 2016-11-03 17:03:23 +01:00
Xinchen Hui 1efb9fd32d Fixed bug #73423 (Reproducible crash with GDB backtrace) 2016-11-02 12:11:30 +08:00
Christoph M. Becker 8957ff36b3 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-01 20:24:10 +01:00
Christoph M. Becker 2eacb53fc4 Fix #73436: Setting allow_url_fopen to Off makes several tests fail
We make sure that these tests run with allow_url_fopen=1.
2016-11-01 20:13:53 +01:00
Anatol Belski 197def7233 add run target
With this it is possible to run some code with the currently compiled
PHP and all the required environment included.
2016-11-01 13:50:46 +01:00
Christoph M. Becker 5693474997 Fix #72696: imagefilltoborder stackoverflow on truecolor images
We must not allow negative color values be passed to
gdImageFillToBorder(), because that can lead to infinite recursion
since the recursion termination condition will not necessarily be met.

(cherry picked from commit 863d37ea66)
2016-11-01 13:07:37 +01:00
Christoph M. Becker 1b5543b8ab Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
Instead of rolling our own bounds check we use clip_1d() as it's done
in gdImageLine() and in external libgd. We must not pass the image
width and height, respectively, but rather the largest ordinate value
that is allowed to be accessed, i.e. width-1 and height-1,
respectively.

(cherry picked from commit 6499581af7)
2016-11-01 13:03:41 +01:00
Stanislav Malyshev 7cf7920055 Fix bug #73144 and bug #73341 - remove extra dtor
(cherry picked from commit f74d7d92c8)

Conflicts:
	ext/spl/spl_array.c

Merged the test only, in 7.0 tree the removed dtor call is already
not present.
2016-11-01 13:01:58 +01:00
Anatol Belski 6b21c28b0e remove unreferenced var came in with merge 2016-11-01 12:55:05 +01:00
Stanislav Malyshev 8c67460a10 Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
Proper soltion would be to call serialize/unserialize and deal with the result,
but this requires more work that should be done by wddx maintainer (not me).

(cherry picked from commit 6045de69c7)

Conflicts:
	ext/wddx/wddx.c
2016-11-01 12:50:33 +01:00
Christoph M. Becker 863d37ea66 Fix #72696: imagefilltoborder stackoverflow on truecolor images
We must not allow negative color values be passed to
gdImageFillToBorder(), because that can lead to infinite recursion
since the recursion termination condition will not necessarily be met.
2016-10-30 14:31:29 -07:00
Christoph M. Becker 6499581af7 Fix #72482: Ilegal write/read access caused by gdImageAALine overflow
Instead of rolling our own bounds check we use clip_1d() as it's done
in gdImageLine() and in external libgd. We must not pass the image
width and height, respectively, but rather the largest ordinate value
that is allowed to be accessed, i.e. width-1 and height-1,
respectively.
2016-10-30 14:28:23 -07:00
Anatol Belski 4b472b0763 prefer symbols read from the bin to those matching the naming scheme 2016-10-30 21:26:19 +01:00
Anatol Belski 4dfd7de974 remove debug out 2016-10-30 21:12:50 +01:00
Anatol Belski c5a4a6f1f2 fix link with deps pdb availability
Unlike debugger, linker is currently not able to read the pdb files,
even if they're put onto path. As result, a lot of LNK4099 warnings
and in some cases also missing debug information in the end binaries.
This is solved by copying the relevant pdb into the build dir, which
then can be picked up on link time. This also leads to the inclusion
of those pdb files into the debug package, so symbols won't be missed
in crash dumps. As otherwise the debug info for dependencies is only
contained in the dependency packages.
2016-10-30 20:55:38 +01:00
Anatol Belski cdea5eb941 use rather the makefile var 2016-10-30 15:29:13 +01:00
Anatol Belski 78a164bad5 rename the env setting target and reuse it for build-snap 2016-10-30 15:22:45 +01:00
Bob Weinand 36527eccbb Fixed build failure introduced by PR #2158
Note: AC_TRY_LINK interprets the source as part of a main function, ending up with int main() { /* ... */ int main() { /* ... */ } ; return 0; } here - Using AC_LINK_IFELSE with AC_LANG_SOURCE directly instead.
2016-10-29 18:49:38 +02:00
Anatol Belski c7ec36d4fa fix condition 2016-10-29 17:54:26 +02:00
Xinchen Hui af873d4788 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #73402 (Opcache segfault when using class constant to call a method)

Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
2016-10-29 23:43:59 +08:00
Xinchen Hui ef75ddd4f9 Fixed bug #73402 (Opcache segfault when using class constant to call a method) 2016-10-29 23:41:51 +08:00
Xinchen Hui 66caa61188 Skip if no jit is built 2016-10-29 14:23:25 +08:00
Anatol Belski ddbcb2084a fix test run with autogenerated ini 2016-10-29 03:17:29 +02:00
Anatol Belski 5b04a2187e generate test ini file, so shared exts are loaded for nmake test 2016-10-29 02:08:48 +02:00
Anatol Belski f5131c6c04 additional env is generated for phpize, too 2016-10-28 23:11:47 +02:00
Xinchen Hui e5aa365147 Fixed bug #73392 (A use-after-free in zend allocator management) 2016-10-28 21:21:24 +08:00
Ferenc Kovacs 09a224d702 Merge branch 'PHP-5.6' into PHP-7.0 2016-10-27 23:37:51 +02:00
Ferenc Kovacs 9b3a1e00ab 5.6.29 will be next 2016-10-27 23:10:59 +02:00
Anatol Belski a481291f02 use rather the nmake var as it's evaluated on every run 2016-10-27 22:34:34 +02:00
Anatol Belski 1be8339891 prepend known bin folders to the path for nmake test runs 2016-10-27 20:41:41 +02:00
Anatol Belski e586c7c612 yet another uninitialized pointer 2016-10-27 02:42:30 +02:00
Anatol Belski b9993c8b6c fix uninitialized pointer 2016-10-27 02:15:14 +02:00
Dmitry Stogov 3fb0a1a4e7 Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO) 2016-10-26 15:17:09 +03:00
Anatol Belski 0f9a4af90b make config.w32 compatible with ICU 58 2016-10-26 13:05:03 +02:00
Christoph M. Becker af4bfe234c Merge branch 'PHP-5.6' into PHP-7.0 2016-10-25 14:31:41 +02:00
Christoph M. Becker cd13d0260a Fix #72494: imagecropauto out-of-bounds access
This issue has actually already been fixed with commit 46f2c690. We're
adding a regression test and a NEWS entry, and also port the fix in
gdImageCropThreshold() from libgd:
  * <https://github.com/libgd/libgd/commit/b347e034>
  * <https://github.com/libgd/libgd/commit/46f2c690>
2016-10-25 14:29:48 +02:00
Anatol Belski 12bb3cd8d2 fix version 2016-10-25 11:18:07 +02:00
Anatol Belski 41923c1943 set versions 2016-10-25 10:40:23 +02:00
Anatol Belski 277e829f10 move dev to 7.0.14 2016-10-25 10:29:51 +02:00
Derick Rethans 7544040469 Updated to version 2016.8 (2016h) 2016-10-24 10:37:13 +01:00
Derick Rethans 76293254cf Empty merge 2016-10-24 10:37:12 +01:00
Derick Rethans 4f5a755b9d Updated to version 2016.8 (2016h) 2016-10-24 10:37:07 +01:00
Stanislav Malyshev f74d7d92c8 Fix bug #73144 and bug #73341 - remove extra dtor 2016-10-23 22:03:16 -07:00
Stanislav Malyshev 6045de69c7 Fix bug #73331 - do not try to serialize/unserialize objects wddx can not handle
Proper soltion would be to call serialize/unserialize and deal with the result,
but this requires more work that should be done by wddx maintainer (not me).
2016-10-23 20:09:23 -07:00
Nikita Popov 89d3e234af Fix test output
Changed due to eca84946a4.
2016-10-23 22:26:25 +02:00
Xinchen Hui eca84946a4 Fixed bug #73350 (Exception::__toString() cause circular references) 2016-10-22 14:50:21 +08:00
Adam Saponara 55d17662cb Fix bug #71241: array_replace_recursive mutates ref params
`array_replace_recursive` can sometimes mutate its params if
references are nested within. This differs from the PHP 5 behavior.
2016-10-20 13:22:04 +02:00
Leigh c3361f16c7 Add php_random_int internal API
This is the internal API compliment to `php_random_bytes`
2016-10-20 10:18:07 +01:00
Joe Watkins 9e480a1766 news entry for #pr 2152 2016-10-20 05:21:56 +01:00
Joe Watkins 295377630a Merge branch 'pull-request/2152' into PHP-7.0 2016-10-20 05:19:10 +01:00
Anatol Belski b754bc797c update NEWS 2016-10-18 19:43:12 +02:00
Anatol Belski 9f2ab75b10 Fixed bug #73329 (Float)"Nano" == NAN
The special cases (float)"inf", etc. were never intended and are
caused by the updated strtod lib. While it might be nice as an
easy way to produce Inf and NaN special values, it was never
documented and cause BC breaches.
2016-10-18 19:11:18 +02:00
Anatol Belski b4371a4292 sync NEWS
48f1a178 is reverted
2016-10-18 18:18:04 +02:00
Bob Weinand 8b177f6a2a Fixed bug #73338 (Exception thrown from error handler may crash) 2016-10-18 14:14:24 +02:00
Dmitry Stogov 7bd4e7208e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #73337 (try/catch not working with two exceptions inside a same operation)
2016-10-18 15:04:49 +03:00
Dmitry Stogov 6558559bcc Fixed bug #73337 (try/catch not working with two exceptions inside a same operation) 2016-10-18 14:48:01 +03:00
Joe Watkins 8c74be0c52 Revert "Fix bug #47890 #73215 uniqid() should use better random source"
This reverts commit 48f1a17886.
2016-10-18 11:30:19 +01:00
Yasuo Ohgaki 10a075fbd5 Update NEWS 2016-10-18 09:28:18 +09:00
Yasuo Ohgaki 48f1a17886 Fix bug #47890 #73215 uniqid() should use better random source 2016-10-18 09:13:42 +09:00
Christoph M. Becker 0b596f81b8 Merge branch 'PHP-5.6' into PHP-7.0
We also use ZEND_LONG_(MAX|MIN) now instead of LONG_(MAX|MIN).
2016-10-17 23:38:28 +02:00
Christoph M. Becker 86e603a664 Fix #73333: 2147483647 is fetched as string
We return all integers that can be represented as such by PHP as
integers, and only those that exceed the possible range as strings.
On builds which represent integers with 64 bits, the range check is
unnecessary and might cause code checkers to complain, so we skip this
special casing via the preprocessor according to
<http://git.php.net/?p=php-src.git;a=commit;h=99d087e5>.
2016-10-17 23:34:41 +02:00
Anatol Belski f85cc6aead sync NEWS 2016-10-17 21:26:34 +02:00
Joe Watkins 39ee3184ee Merge branch 'pull-request/1817' 2016-10-17 17:01:39 +01:00
Joe Watkins 5eb84337a6 Merge branch 'pull-request/1816' 2016-10-17 17:01:28 +01:00
Joe Watkins 522e4f1174 Merge branch 'pull-request/1814' 2016-10-17 17:01:10 +01:00
Joe Watkins 6806a41e7f Merge branch 'pull-request/1808' 2016-10-17 17:00:50 +01:00
Joe Watkins 96ed946b2b Merge branch 'pull-request/2097' 2016-10-17 16:03:12 +01:00
Joe Watkins bd6bce888a news entry for pr #2158 2016-10-17 15:50:59 +01:00
Joe Watkins 8d6cc00cbd Merge branch 'pull-request/2158' 2016-10-17 15:48:32 +01:00
Christopher Jones 8be59a1301 Fixed bug #71148 (Bind reference overwritten on PHP 7) 2016-10-17 12:40:14 +11:00
Bob Weinand d82da7de3a Fixed bug #71234 (INI files are loaded even invoked as phpdbg -n --version) 2016-10-16 15:41:37 +02:00
Bob Weinand e93eaee164 Fixed bug #70776 (Simple SIGINT does not have any effect) 2016-10-16 13:47:49 +02:00
Anatol Belski 6d91772c2f sync NEWS 2016-10-14 19:52:04 +02:00
Remi Collet f1cf340e19 bump ext/zip version 2016-10-14 17:31:07 +02:00
Bob Weinand 466870e2b0 Fix memory leak when compiling files in phpdbg 2016-10-14 12:24:28 +02:00
Remi Collet 428ef50838 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  use zend_error instead of zend_error_noreturn
2016-10-14 10:54:09 +02:00
Remi Collet e1f5b6d8df use zend_error instead of zend_error_noreturn 2016-10-14 10:53:40 +02:00
Ferenc Kovacs d0b9d72da7 Merge branch 'PHP-5.6' into PHP-7.0 2016-10-14 08:08:10 +02:00
Ferenc Kovacs f7bf9650aa add missing NEWS entries for 5.6.27 2016-10-14 08:06:14 +02:00
Keith Smiley 3b9ba6195d soap #69137 - Invert logic to be correct 2016-10-13 23:56:24 -04:00
Anatol Belski 5ba9eab436 missed piece for renaming 2016-10-13 15:39:02 +02:00
Anatol Belski 730288ae41 rename publicly exposed symbol to avoid name conflicts 2016-10-13 15:23:50 +02:00
Bob Weinand d14498a475 Ignore non-executable opcodes in line mode of phpdbg_end_oplog() 2016-10-13 14:09:56 +02:00
Christoph M. Becker b8fab503fe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-13 11:25:11 +02:00
Christoph M. Becker cc08cbc84d Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative `rlen` as size to memcpy().

Cf. <https://github.com/libgd/libgd/commit/53110871>.
2016-10-13 11:10:02 +02:00
Anatol Belski ce3e792c2c use already exported symbol 2016-10-13 09:55:37 +02:00
Anatol Belski 3104882cf8 Revert "export symbol missing by phpdbg"
This reverts commit 611ab7fe5b.

Overseen strpprintf is there
2016-10-13 09:50:32 +02:00
Stanislav Malyshev cd8c9b0614 Fix outlen for openssl function
Even though datalen can't be over int, outlen can.
2016-10-12 23:19:07 -07:00
Stanislav Malyshev 2301608736 Syncronize with 5.6 - __toString should return "" 2016-10-12 23:09:49 -07:00
Stanislav Malyshev 9c50ba42d6 Fix potential overflows in php_pcre_replace_impl 2016-10-12 23:07:47 -07:00
Anatol Belski 0723a226c3 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Clear FG(user_stream_current_filename) when bailing out
  Fix tests
  fix tsrm
  Fix bug #73284 - heap overflow in php_ereg_replace function
  Fix bug #73276 - crash in openssl_random_pseudo_bytes function
  Fix bug #73293 - NULL pointer dereference in SimpleXMLElement::asXML()
  fix bug #73275 - crash in openssl_encrypt function
  Fix for #73240 - Write out of bounds at number_format
  Bug #73218: add mitigation for ICU int overflow
  Add more locale length checks, due to ICU bugs.
  Fix bug #73208 - another missing length check
  Fix bug #73190: memcpy negative parameter _bc_new_num_ex
  Fix bug #73189 - Memcpy negative size parameter php_resolve_path
  Fixed bug #73174 - heap overflow in php_pcre_replace_impl
  Fix bug #73150: missing NULL check in dom_document_save_html
  Fix bug #73147: Use After Free in PHP7 unserialize()
  Fix bug #73082
  Fix bug #73073 - CachingIterator null dereference when convert to string
2016-10-13 01:31:36 +02:00
Keith Smiley 26287132c0 Fixed bug #73237
If the response includes both fields with simple types (which get
concatenated into an XML string) and a complex type (which is parsed
into an object), then the object will parsed into the same zval as the
simple types and will overwrite the string.
2016-10-12 23:12:45 +02:00
Mitch Hagstrand bcee2fdbec Fixed bug in zend_accel_error() and cleaned up kill_all_lockers()
1. zend_accel_error was only executing clean up if log_verbosity_level is high enough to log
2. Cleaned up kill_all_lockers function and fixed comments.
2016-10-12 23:03:55 +02:00
Bob Weinand fe49fd7dad Update NEWS
Also add missing include.inc test file
2016-10-12 22:54:32 +02:00
Nikita Popov fe378c27cc Fix phpdbg tests after lineno change 2016-10-12 22:41:59 +02:00
Nikita Popov 5b429fef42 Fix line number of implicit return in pseudo-main scope 2016-10-12 22:25:41 +02:00
Anatol Belski 611ab7fe5b export symbol missing by phpdbg 2016-10-12 22:18:41 +02:00
Bob Weinand 671d8054f8 Fix accidental PHPDBG_ABI break 2016-10-12 22:16:11 +02:00
Stanislav Malyshev c4c2cce37d Fix bug #73189 - Memcpy negative size parameter php_resolve_path
(cherry picked from commit da7e89cde8)
2016-10-12 21:31:37 +02:00
Anatol Belski 58b18892bf update len in fallback cases 2016-10-12 20:52:46 +02:00
Bob Weinand 5aae01104f Add stdin command and -s command line parameter to phpdbg
This allows reading the initial script file from stdin instead of being forced to put the script into a file in order to run it with phpdbg.
Especially important for programmatic execution of phpdbg.

Also adding tests/include_once.phpt and tests/set_exception_handler.phpt as I seem to have forgotten to git add them sometime long ago...
2016-10-12 20:15:49 +02:00
Stanislav Malyshev 74b5662536 Fix bug #73190: memcpy negative parameter _bc_new_num_ex
(cherry picked from commit 40e7baab3c)
2016-10-12 19:48:25 +02:00
Stanislav Malyshev f42cbd749c Fix bug #73147: Use After Free in PHP7 unserialize()
(cherry picked from commit 0e6fe3a4c9)
2016-10-12 17:51:15 +02:00
Anatol Belski efc1f33b58 fix typo 2016-10-12 17:12:38 +02:00
Anatol Belski 80eb013a92 Revert "Fix for #73240 - Write out of bounds at number_format"
This reverts commit 01280f8deb.

The fix is already merged by Stas.
2016-10-12 16:12:18 +02:00
Anatol Belski b135ba3fa9 followup with #73276 merge 2016-10-12 16:03:35 +02:00
Anatol Belski 7c6cb1282d fix test 2016-10-12 16:03:09 +02:00
Stanislav Malyshev 7dc8b5e7ae Fix bug #73276 - crash in openssl_random_pseudo_bytes function
(cherry picked from commit 85a22a0af0)
2016-10-12 15:55:42 +02:00
Stanislav Malyshev 4ef79370a8 Fix bug #73293 - NULL pointer dereference in SimpleXMLElement::asXML()
(cherry picked from commit 96a8cf8e1b)
2016-10-12 15:40:21 +02:00
Stanislav Malyshev 01280f8deb Fix for #73240 - Write out of bounds at number_format
(cherry picked from commit 8259130b6b)
2016-10-12 14:55:00 +02:00
Anatol Belski aaa5d07365 avoid strlen 2016-10-12 13:28:23 +02:00
Stanislav Malyshev b26b02b2df Bug #73218: add mitigation for ICU int overflow
(cherry picked from commit d946d10293)
2016-10-12 13:22:51 +02:00
Stanislav Malyshev 87a8240b5a Add more locale length checks, due to ICU bugs.
(cherry picked from commit d3eb58332a)
2016-10-12 13:11:16 +02:00
Stanislav Malyshev d1e878f272 Fix bug #73150: missing NULL check in dom_document_save_html
(cherry picked from commit 1c0e9126fb)
2016-10-12 12:19:41 +02:00
Sara Golemon 43ccf23d70 Clear FG(user_stream_current_filename) when bailing out
If a userwrapper opener E_ERRORs then FG(user_stream_current_filename)
would remain set until the next request and would not be pointing
at unallocated memory.

Catch the bailout, clear the variable, then continue bailing.

Closes https://bugs.php.net/bug.php?id=73188
2016-10-11 21:55:01 -07:00
Sara Golemon 4d11a8eedf Clear FG(user_stream_current_filename) when bailing out
If a userwrapper opener E_ERRORs then FG(user_stream_current_filename)
would remain set until the next request and would not be pointing
at unallocated memory.

Catch the bailout, clear the variable, then continue bailing.

Closes https://bugs.php.net/bug.php?id=73188
2016-10-11 21:44:14 -07:00
Stanislav Malyshev 1bdb30a429 Merge branch 'PHP-7.0.12' into PHP-7.0
* PHP-7.0.12:
  set versions and release date
  sync NEWS
  Revert "Fixed bug #73067 (__debugInfo crashes when throwing an exception)"
  Fix for #73240 - Write out of bounds at number_format
  Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key
  set versions
  Fix bug #73091 - Unserializing DateInterval object may lead to __toString invocation
2016-10-11 16:46:51 -07:00
Stanislav Malyshev 9c675607e6 Merge remote-tracking branch 'origin/PHP-7.0.12' into PHP-7.0.12
* origin/PHP-7.0.12: (99 commits)
  set versions and release date
  sync NEWS
  Revert "Fixed bug #73067 (__debugInfo crashes when throwing an exception)"
  set versions
  update NEWS
  Ignore potentially misleading dberr values
  update NEWS
  Fixed bug #73172 parse error: Invalid numeric literal
  Fix #53745: cgi.discard_path option is missing from php.ini
  update libs_versions.txt
  update libs_versions.txt
  Fixed bug #73156 (segfault on undefined function)
  Add an include path for freetype which is relevant for cmake builds
  Fix test_image_equals_file() wrt. palette images
  Fixed bug #73163
  Fix #73161: imagecreatefromgd2() may leak memory
  Fix #73159: imagegd2(): unrecognized formats may result in corrupted files
  Fix #73155: imagegd2() writes wrong chunk sizes on boundaries
  Fix #73157 (again): imagegd2() ignores 3rd param if 4 are given
  Fix #73157: imagegd2() ignores 3rd param if 4 are given
  ...
2016-10-11 16:27:13 -07:00
Stanislav Malyshev 689a9b8def Merge branch 'PHP-5.6.27' into PHP-5.6
* PHP-5.6.27:
  Fix tests
  fix tsrm
  Fix bug #73284 - heap overflow in php_ereg_replace function
  Fix bug #73276 - crash in openssl_random_pseudo_bytes function
  Fix bug #73293 - NULL pointer dereference in SimpleXMLElement::asXML()
  fix bug #73275 - crash in openssl_encrypt function
  Fix for #73240 - Write out of bounds at number_format
  Bug #73218: add mitigation for ICU int overflow
  Add more locale length checks, due to ICU bugs.
  Fix bug #73208 - another missing length check
  Fix bug #73190: memcpy negative parameter _bc_new_num_ex
  Fix bug #73189 - Memcpy negative size parameter php_resolve_path
  Fixed bug #73174 - heap overflow in php_pcre_replace_impl
  Fix bug #73150: missing NULL check in dom_document_save_html
  Fix bug #73147: Use After Free in PHP7 unserialize()
  Fix bug #73082
  Fix bug #73073 - CachingIterator null dereference when convert to string
2016-10-11 16:26:35 -07:00
Stanislav Malyshev 082d1f2375 Fix tests 2016-10-11 16:18:08 -07:00
Stanislav Malyshev c1112ff323 fix tsrm 2016-10-11 14:39:16 -07:00
Stanislav Malyshev 21452a5401 Fix bug #73284 - heap overflow in php_ereg_replace function 2016-10-11 14:16:51 -07:00
Stanislav Malyshev 85a22a0af0 Fix bug #73276 - crash in openssl_random_pseudo_bytes function 2016-10-11 13:37:47 -07:00
Stanislav Malyshev 96a8cf8e1b Fix bug #73293 - NULL pointer dereference in SimpleXMLElement::asXML() 2016-10-11 13:30:52 -07:00
Stanislav Malyshev 8822f7c9f0 fix bug #73275 - crash in openssl_encrypt function 2016-10-11 13:19:20 -07:00
Anatol Belski 5899f76a7d update NEWS 2016-10-11 11:41:45 +02:00
Anatol Belski 92c55f1580 set versions and release date 2016-10-11 11:26:32 +02:00
Anatol Belski a5f40e2656 sync NEWS 2016-10-11 11:25:00 +02:00
Anatol Belski 8c9f639a1d Revert "Fixed bug #73067 (__debugInfo crashes when throwing an exception)"
This reverts commit 2d8ab51576.
2016-10-11 11:24:08 +02:00
Stanislav Malyshev 3b5262ec4c Fix for #73240 - Write out of bounds at number_format 2016-10-10 23:49:28 -07:00
Stanislav Malyshev 8259130b6b Fix for #73240 - Write out of bounds at number_format 2016-10-10 23:42:50 -07:00
Stanislav Malyshev 61cdd1255d Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key 2016-10-10 22:54:29 -07:00
Anatol Belski 29a089d3c9 update NEWS 2016-10-10 20:57:57 +02:00
Anatol Belski bf400108d9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-10-10 20:57:23 +02:00
Anatol Belski 4165d97606 update NEWS 2016-10-10 20:55:44 +02:00
Anatol Belski 62c68f7483 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test for bug #73037
2016-10-10 16:02:30 +02:00
Anatol Belski 256b150a96 add test for bug #73037 2016-10-10 15:59:52 +02:00
Nikita Popov c91f652ddb Fixed bug #73273
As well as a few other $_SESSION separation issues.
2016-10-10 12:20:44 +02:00
Christoph M. Becker fb08216b08 Merge branch 'PHP-5.6' into PHP-7.0 2016-10-10 11:45:53 +02:00
Christoph M. Becker fc989fc6e7 Fix #73279: Integer overflow in gdImageScaleBilinearPalette()
The color components are supposed to be in range 0..255, so we must not
cast them to `signed char`, what can be the default for `char`.

Port of <https://github.com/libgd/libgd/commit/77c8d359>.
2016-10-10 11:41:39 +02:00
Christoph M. Becker c930714cbe Merge branch 'PHP-5.6' into PHP-7.0 2016-10-09 15:14:17 +02:00
Christoph M. Becker b92216b97d Fix #73272: imagescale() affects imagesetinterpolation()
We must not permanently change the interpolation method, but rather
have to restore the old method after we're done with scaling the image.
2016-10-09 15:10:34 +02:00
Anatol Belski 6f84ac721b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-10-08 19:25:36 +02:00
Anatol Belski 3c5742ebd7 fix leak 2016-10-08 19:07:35 +02:00
Nikita Popov 2a75f5026a Fix bug #66773, #66862
This a partial backport of 8754b19. It
a) fixes the class/function/constant import table confusion in the
   namespaced case, and
b) restricts conflict checks to a single file based on a filename
   pointer comparison.

It does not fix the issues with filename reuse (e.g. due to eval)
and late-bound classes. This part of the change requires globals
changes.
2016-10-08 17:00:27 +02:00
Nikita Popov 159de7723e Merge branch 'PHP-5.6' into PHP-7.0 2016-10-08 01:06:02 +02:00
Nikita Popov b061fa909d Fix bug #73192 2016-10-08 01:04:22 +02:00
Nikita Popov bc3a0b82b8 Revert "Fixed test"
This reverts commit a10d03ac16.
2016-10-08 00:43:36 +02:00
Nikita Popov 1c468ee044 Revert "Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986"
This reverts commit 085dfca02b.
2016-10-08 00:43:17 +02:00
Christoph M. Becker 825e0fd430 Document that ext/shmop deals with resources as of PHP 7.0.0
Second attempt
2016-10-07 16:35:37 +02:00
Anatol Belski ea83e504e5 fix datatype 2016-10-06 11:01:27 +02:00
Anatol Belski 5b79e95f7b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #73037, second round
2016-10-05 15:03:38 +02:00
Anatol Belski 07546496b1 Fix bug #73037, second round 2016-10-05 14:54:06 +02:00
Bob Weinand 4790da5475 Update run command for allowing STDIN 2016-10-05 12:14:02 +02:00
Bob Weinand eaff72f31b Remove phpdbg fix targeting 7.1 which landed in 7.0 2016-10-05 12:08:20 +02:00
Stanislav Malyshev d946d10293 Bug #73218: add mitigation for ICU int overflow 2016-10-04 22:40:43 -07:00
Stanislav Malyshev 56e19b7c75 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test
  Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986
  Apparently negative wordwrap is a thing and should work as length = 0.
2016-10-04 21:56:28 -07:00
Stanislav Malyshev d3eb58332a Add more locale length checks, due to ICU bugs. 2016-10-04 21:28:40 -07:00
Ilia Alshanetsky a10d03ac16 Fixed test 2016-10-04 21:20:38 -07:00
Ilia Alshanetsky 085dfca02b Added validation to parse_url() to prohibit restricted characters inside login/pass components based on RFC3986 2016-10-04 21:20:31 -07:00
Stanislav Malyshev 8ea01d5f19 Apparently negative wordwrap is a thing and should work as length = 0.
I'll leave it as is for now.
2016-10-03 19:17:42 -07:00
Stanislav Malyshev 49b45e5af1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Really fix bug #73017
2016-10-03 18:38:46 -07:00
Stanislav Malyshev 631173aa5c Really fix bug #73017 2016-10-03 18:07:21 -07:00
Keith Smiley 31cbce341c soap #69137 - Fix SSL verify when using a proxy
Name verification was failing because the OpenSSL extension was picking
the proxy server's address when guessing which name to compare to the
SSL certificate. This scenario is already handled for stream wrappers
in http_fopen_wrapper.c. This patch applies the same fix to the SOAP
extension: when a proxy is used, set peer_name explicitly on the stream
context.
2016-10-03 14:02:34 -04:00
Bob Weinand 8908df690f Fix crash on Linux due to double fclose() 2016-10-03 12:55:06 +02:00
Stanislav Malyshev ef801b9bf9 Fix bug #73208 - another missing length check 2016-10-03 00:12:14 -07:00
Stanislav Malyshev 40e7baab3c Fix bug #73190: memcpy negative parameter _bc_new_num_ex 2016-10-03 00:09:02 -07:00
Bob Weinand 417a8ef6b4 Fix run command args passing when inmidst execution 2016-10-02 12:45:20 +01:00
Bob Weinand 9d537951c5 Add proper escape sequences and reading stdin from file in phpdbg run command 2016-10-01 19:05:19 +01:00
Nikita Popov 633b93817e Merge branch 'PHP-5.6' into PHP-7.0 2016-10-01 19:05:48 +02:00
Nikita Popov f9d4b1a3f1 Fix leak in zend_exception_error
Only occurs if a non-fatal severity level is used, e.g. when using
interactive mode.
2016-10-01 19:04:31 +02:00
Bob Weinand 3280a29ee5 Fix invalid access to interned strings after they are freed in phpdbg 2016-10-01 10:46:21 +01:00
Christoph M. Becker 12967bc346 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-30 23:54:18 +02:00
Christoph M. Becker 9acfb1a3a5 Fix #73213: Integer overflow in imageline() with antialiasing
We port the respective fixes <https://github.com/libgd/libgd/commit/eca37d620>
and <https://github.com/libgd/libgd/commit/837b7327> to our bundled libgd.
2016-09-30 23:38:13 +02:00
Derick Rethans 6ad288ee23 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-30 20:49:53 +01:00
Derick Rethans c0219b323e Fixed tests due to changes in underlaying data 2016-09-30 20:49:44 +01:00
Derick Rethans 7deb32abc9 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-30 20:31:05 +01:00
Derick Rethans 91fd4bf000 Fixed parsing of AM/PM without all the expected dots in place 2016-09-30 20:21:48 +01:00
Christoph M. Becker dd93712911 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-30 11:40:55 +02:00
Christoph M. Becker e72165bb86 Fix #73203: passing additional_parameters causes mail to fail
We make sure that there's no unsigned underflow, which happened for `y==0`.
2016-09-30 11:38:09 +02:00
Joe Watkins e60620b974 Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0 2016-09-30 07:22:50 +01:00
Joe Watkins a8d031fbd8 fix user filter bug 2016-09-30 07:21:01 +01:00
Christoph M. Becker 81cbbb68af Merge branch 'pull-request/2128' into PHP-7.0 2016-09-29 14:39:39 +02:00
Anatol Belski 62bed405da sync win32 makefile with makedist zendparse exports
With a newer bison this part is relevant. Whil bison 2.4.1 is still
used, this changes cater for the forward compatibility.
2016-09-29 12:56:49 +02:00
Dmitry Stogov e7f4355d9b Better fix for bug #72854 (avoid extra copy and creating reference to stack variable) 2016-09-29 10:56:01 +03:00
Stanislav Malyshev da7e89cde8 Fix bug #73189 - Memcpy negative size parameter php_resolve_path 2016-09-28 23:30:48 -07:00
Stanislav Malyshev 29e2a204fb Fixed bug #73174 - heap overflow in php_pcre_replace_impl 2016-09-28 22:29:59 -07:00
Ferenc Kovacs 581e890483 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	configure.in
	main/php_version.h
2016-09-29 00:58:02 +02:00
Ferenc Kovacs 703c247c7d 5.6.28 is next 2016-09-29 00:55:36 +02:00
Derick Rethans 83780a6cd2 Updated to version 2016.7 (2016g) 2016-09-28 23:30:27 +01:00
Derick Rethans 03ac064b2e Empty merge 2016-09-28 23:30:27 +01:00
Derick Rethans 6a544f2d1e Updated to version 2016.7 (2016g) 2016-09-28 23:30:26 +01:00
Nikita Popov e520b9e127 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-28 23:22:11 +02:00
Nikita Popov 1f5412982c Handle resource keys in constexpr arrays 2016-09-28 23:11:02 +02:00
Nikita Popov 40b8105cca Fix the constant array case as well 2016-09-28 23:05:21 +02:00
Nikita Popov 437942d972 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-28 22:36:58 +02:00
Nikita Popov 99bf19c177 Check next_index_insert failure in ADD_ARRAY_ELEMENT 2016-09-28 22:35:27 +02:00
Nikita Popov b7cbaa7f43 Fix bug #73181 2016-09-27 19:47:48 +02:00
Anatol Belski cb29c01ed6 prepare next 2016-09-27 12:49:52 +02:00
Anatol Belski fcc232173e set versions 2016-09-27 12:38:38 +02:00
Adam Baratz 6887c4a061 update NEWS 2016-09-26 17:09:11 -04:00
Chris Kings-Lynne 48b5a1f9b9 Ignore potentially misleading dberr values
FreeTDS had a buggy behavior where it would pass invalid values:
https://sourceforge.net/p/freetds/bugs/59/

The fix for this issue -- bc22b2ef817fb5d102bd758111ff3634b39a1319 on their
repo -- was to always use SYBESMSG for dberr. This makes it so the existing
pdo_dblib code would work as is. But by ignoring the dberr value in this
function, it will behave correctly, even with older versions of FreeTDS.
2016-09-26 17:07:46 -04:00
Anatol Belski 3a058e3817 update NEWS 2016-09-26 19:54:10 +02:00
Anatol Belski f36babf643 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-09-26 18:54:43 +02:00
Anatol Belski 39e5991705 Fixed bug #73172 parse error: Invalid numeric literal 2016-09-26 18:47:30 +02:00
Christoph M. Becker 5e102d5685 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-26 18:43:03 +02:00
Christoph M. Becker 4f0960a800 Fix #53745: cgi.discard_path option is missing from php.ini
Also cgi.check_shebang_line has been missing.
2016-09-26 18:41:09 +02:00
Anatol Belski eaee65080e update libs_versions.txt 2016-09-26 15:41:41 +02:00
Anatol Belski 5dd3ea1567 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-09-26 15:41:16 +02:00
Anatol Belski 66baefec44 update libs_versions.txt 2016-09-26 15:39:01 +02:00
Dmitry Stogov d279118422 Fixed bug #73156 (segfault on undefined function) 2016-09-26 14:14:57 +03:00
Stanislav Malyshev 1c0e9126fb Fix bug #73150: missing NULL check in dom_document_save_html 2016-09-25 21:25:01 -07:00
Stanislav Malyshev 0e6fe3a4c9 Fix bug #73147: Use After Free in PHP7 unserialize() 2016-09-25 19:53:59 -07:00
Stanislav Malyshev 1b29e4488e Fix bug #73091 - Unserializing DateInterval object may lead to __toString invocation 2016-09-25 16:43:24 -07:00
Stanislav Malyshev e1709b7e58 Fix bug #73082 2016-09-25 16:07:14 -07:00
Anatol Belski 4e7b5ca459 Add an include path for freetype which is relevant for cmake builds 2016-09-25 20:55:13 +02:00
Christoph M. Becker fa9d41f66c Merge branch 'PHP-5.6' into PHP-7.0 2016-09-25 10:46:44 +02:00
Christoph M. Becker c696bc8cfa Fix test_image_equals_file() wrt. palette images
The recently introduced test_image_equals_file() doesn't properly work for
palette images, because in this case only the palette indexes are compared,
what can lead to false positives and negatives as shown in the added test.

To fix that we convert palette images to truecolor, what is supposed to be
faster than calling imagecolorsforindex() for each pixel.

We furthermore rely on PHP's refcounting to free unused images; after all,
this is not C.
2016-09-25 10:34:03 +02:00
Christoph M. Becker bc22582cf7 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 18:05:21 +02:00
Christoph M. Becker c596b02a5b Merge branch 'pull-request/2120' into PHP-5.6 2016-09-24 17:52:15 +02:00
Nikita Popov 8831a12da1 Fixed bug #73163 2016-09-24 13:18:43 +02:00
Christoph M. Becker 5c81298597 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 12:41:48 +02:00
Christoph M. Becker 8f5eda4bf6 Fix #73161: imagecreatefromgd2() may leak memory 2016-09-24 12:36:54 +02:00
Christoph M. Becker 61722743f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 11:31:54 +02:00
Christoph M. Becker 709731797c Fix #73159: imagegd2(): unrecognized formats may result in corrupted files
We must not apply the format correction twice for truecolor images.
2016-09-24 11:28:20 +02:00
Christoph M. Becker 0a4b72fa94 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 10:48:24 +02:00
Christoph M. Becker c7936ead8f Fix #73155: imagegd2() writes wrong chunk sizes on boundaries 2016-09-24 10:33:49 +02:00
Christoph M. Becker 7028ba1d32 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-24 00:36:53 +02:00
Christoph M. Becker 1da79a6c6e Fix #73157 (again): imagegd2() ignores 3rd param if 4 are given
Obviously, there was a bad merge.
2016-09-24 00:35:24 +02:00
Christoph M. Becker 456be3ec37 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-23 23:46:22 +02:00
Christoph M. Becker c240978067 Fix #73157: imagegd2() ignores 3rd param if 4 are given
We must initialize `q` for *more* than three parameters, too.
2016-09-23 23:42:34 +02:00
Anatol Belski 4685297f05 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Revert "Fixed bug #73037 SoapServer reports Bad Request when gzipped"
2016-09-23 18:46:51 +02:00
Anatol Belski 075aa911ff Revert "Fixed bug #73037 SoapServer reports Bad Request when gzipped"
This reverts commit f9a699f6c3.
2016-09-23 18:45:03 +02:00
Anatol Belski f9936000da Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  skip this test for now as it seems to have issues running dev server
  Fixed bug #73037 SoapServer reports Bad Request when gzipped
2016-09-23 18:10:07 +02:00
Anatol Belski 28887fe41b skip this test for now as it seems to have issues running dev server 2016-09-23 18:07:08 +02:00
Anatol Belski f9a699f6c3 Fixed bug #73037 SoapServer reports Bad Request when gzipped
(cherry picked from commit 410c68788a)
2016-09-23 18:06:12 +02:00
Christoph M. Becker be4489d488 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-23 16:26:05 +02:00
Christoph M. Becker 9a2a45c1df Update NEWS 2016-09-23 16:23:58 +02:00
Anatol Belski 410c68788a Fixed bug #73037 SoapServer reports Bad Request when gzipped 2016-09-23 16:02:50 +02:00
Julien Pauli fbf87a8082 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Formatting. Fix possible memory corruption in FPM SHM management
  fix every work call mmap
2016-09-23 13:53:22 +02:00
Julien Pauli a22175b06f Formatting. Fix possible memory corruption in FPM SHM management 2016-09-23 13:52:58 +02:00
tom916 807004a446 fix every work call mmap
fix fpm_scoreboard_free
2016-09-23 13:52:58 +02:00
Christoph M. Becker deda058751 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-23 12:29:37 +02:00
Christoph M. Becker 726c5999eb Rework FreeType related tests
Firstly, there is no fundamental difference between running the tests on
freetype before and after 2.4.10, so we re-join the respective test cases.

Secondly, there are some minor differences in the results depending on
architecture, freetype versions and config options, so we cater to that
by allowing small deviations from the expectations.
2016-09-23 12:00:41 +02:00
Anatol Belski 9ee913a773 update NEWS 2016-09-23 11:24:55 +02:00
Bob Weinand cf35dae6e2 phpdbg next command must stop when leaving function 2016-09-23 03:29:37 +02:00
Anatol Belski 54d8053ac5 Fix bug #73121 Bundled PCRE doesn't compile because JIT isn't supported on s390 2016-09-23 01:52:42 +02:00
Anatol Belski a95caa29bf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs versions
2016-09-22 17:03:12 +02:00
Anatol Belski 11ff616d0f update libs versions 2016-09-22 17:02:54 +02:00
Anatol Belski 49c3fa43ad update libs versions 2016-09-22 17:01:02 +02:00
Nikita Popov c38f88ddb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-22 12:48:38 +02:00
Márcio Almada 4397306b32 fix bug related to #865
In case USE_KEY flag is active, RegexIterator->accept() should keep it's
old behavior which is to accept keys mapping arrays.

This broke after PHP 5.5 but was not noticed due to lack of tests for USE_KEY.
2016-09-22 12:46:19 +02:00
John Boehr 68e602ff0a Fix bug #69579 2016-09-22 12:38:07 +02:00
Anatol Belski adaf68c3b1 update NEWS 2016-09-22 12:04:37 +02:00
Anatol Belski 579c8669c8 Fixed bug #73126 Cannot pass parameter 1 by reference 2016-09-22 11:49:35 +02:00
Adam Baratz d334d319f0 Limit size of result set for test query
This result set can be very large, depending on the database. This change
ensures this test won't be slow.
2016-09-21 16:21:33 -04:00
Adam Baratz 4b9810b9bb update NEWS 2016-09-21 14:29:42 -04:00
Peter LeBrun dfd6baee0c PHP bug 67130: nextRowset should work with unfetched rows 2016-09-21 14:27:23 -04:00
Adam Baratz b29ad29b91 Move dtor before memory freed to avoid invalid read 2016-09-21 12:00:19 -04:00
Xinchen Hui 56e3ec93a9 Fixed skip 2016-09-21 17:20:02 +08:00
Stanislav Malyshev 33a8af0510 Fix bug #73073 - CachingIterator null dereference when convert to string 2016-09-20 22:59:12 -07:00
Christoph M. Becker eeb9113b6c Skip failing FreeType tests for now 2016-09-20 12:16:16 +02:00
Dmitry Stogov 3c16384ea2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed inconsistent meaning of zend_startup_module_ex() return value used in zend_hash_apply()
2016-09-20 12:34:40 +03:00
Dmitry Stogov 4dd70b6e2f Fixed inconsistent meaning of zend_startup_module_ex() return value used in zend_hash_apply() 2016-09-20 12:29:57 +03:00
Christoph M. Becker ba2d9e1ff1 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-20 01:25:08 +02:00
Christoph M. Becker fc2cadca2d Merge branch 'pull-request/1845' into PHP-5.6 2016-09-20 01:05:57 +02:00
George Wang ca24c58e65 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-19 10:49:26 -04:00
George Wang 56fa36b0a8 Fix wrong year in previous commit. 2016-09-19 10:46:46 -04:00
Julien Pauli c4f3ea10e4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Do not wrap user exception in case of custom JSON serialization

Conflicts:
	ext/json/json.c
2016-09-19 16:11:17 +02:00
Julien Pauli 1ed4b13fb6 Do not wrap user exception in case of custom JSON serialization 2016-09-19 16:06:12 +02:00
Nikita Popov 01759c4346 Add test for bug #72489 2016-09-17 22:54:25 +02:00
Nikita Popov 896814e139 Make zval_ptr_dtor / _zval_dtor_func more robust
In particular, allow arrays with refcount>1, like we already allow
for all other types. _zval_dtor_func is now the same as
_zval_dtor_func_for_ptr with an extra refcount decrement check at
the start. At this point we might as well drop it...

Cherry-pick of ded69ee6e6 from
PHP-7.1.
2016-09-17 22:33:41 +02:00
Christoph M. Becker 48cf8dd9c3 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-16 23:43:18 +02:00
Christoph M. Becker 6682673070 Fix #73100: session_destroy null dereference in ps_files_path_create 2016-09-16 23:41:10 +02:00
Michael Orlitzky 0e76cafaf1 Disable add/sub asm for gcc 4.9 pic/pie builds 2016-09-16 21:06:02 +02:00
Xinchen Hui 0ad82e41f2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updte NEWS
  Fixed bug #72505 (readfile() mangles files larger than 2G)
2016-09-16 20:55:54 +08:00
Xinchen Hui 01c7c6b152 Updte NEWS 2016-09-16 20:55:37 +08:00
Xinchen Hui ac07008bb7 Fixed bug #72505 (readfile() mangles files larger than 2G) 2016-09-16 20:53:51 +08:00
Christoph M. Becker c18263e0e0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-16 11:41:42 +02:00
Christoph M. Becker 46df064261 Fix #73003: Integer Overflow in gdImageWebpCtx of gd_webp.c
We add the missing integer overflow check to avoid potential buffer overflows.
2016-09-16 11:37:18 +02:00
Remi Collet d2d77c028d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test (32bits)
2016-09-15 15:36:26 +02:00
Remi Collet 3c117d4136 fix test (32bits) 2016-09-15 15:32:39 +02:00
Remi Collet 19e04784ac Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix ZTS build
2016-09-15 13:29:26 +02:00
Remi Collet 55237fe153 fix ZTS build 2016-09-15 13:27:20 +02:00
Christoph M. Becker 44968927d7 Add CURLE_SSL_PINNEDPUBKEYNOTMATCH
This error constant is returned on key mismatch when CURLOPT_PINNEDPUBLICKEY
is used. As the option had been introduced in PHP 7.0.7, it makes sense to
also add the related error constant to PHP 7.0+.

Cf. <https://curl.haxx.se/libcurl/c/CURLOPT_PINNEDPUBLICKEY.html>.
2016-09-15 12:20:19 +02:00
Ferenc Kovacs 30b7f72300 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-15 11:37:30 +02:00
Ferenc Kovacs 1d7484077a update NEWS 2016-09-15 11:35:46 +02:00
Christoph M. Becker cf9e2fbbf6 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-15 00:50:49 +02:00
Christoph M. Becker 7bfb7b62b1 Fix and reactivate regression test for bug #50194
Apparently, different FreeType versions render the string differently, so
we have to cater to these slight differences. Unfortunately, the testing
framework doesn't yet offer a clean API for this, so we work around the
limitations by parsing and checking the output of test_image_equals_file().
2016-09-15 00:46:00 +02:00
Adam Baratz b424d9f270 Mark change with relevant bug number 2016-09-14 17:44:56 -04:00
Christoph M. Becker 7a923c3afe Merge branch 'PHP-5.6' into PHP-7.0 2016-09-14 20:02:05 +02:00
Christoph M. Becker 36df4f8419 Skip ext/gd/tests/bug50194.phpt for now
There are apparently issues with the font rendering with different freetype
version; I'll have a look at this issue ASAP.
2016-09-14 20:00:30 +02:00
Adam Baratz 744d1b3c76 Add pdo_dblib changes 2016-09-14 11:19:31 -04:00
Adam Baratz f559fb7556 Skip test for early TDS versions 2016-09-14 11:06:54 -04:00
Christoph M. Becker bc27ce98ee Merge branch 'PHP-5.6' into PHP-7.0 2016-09-14 15:50:09 +02:00
Christoph M. Becker 09eb6ed35e Fix #50194: imagettftext broken on transparent background w/o alphablending
We must not draw the background pixels of the character glyphs, what has
already been fixed in GD 2.0.26.
2016-09-14 15:47:32 +02:00
Jakub Zelenka cfc8522238 Sync NEWS for bug #73072 2016-09-14 12:31:45 +01:00
Adam Baratz bcee34c649 Add special case for earlier versions of TDS 2016-09-13 17:01:51 -04:00
Adam Baratz 0de333bd62 Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib 2016-09-13 16:43:33 -04:00
Adam Baratz 69eef8c361 Free error and message strings when cleaning up PDO instances that use pdo_dblib 2016-09-13 16:43:30 -04:00
Adam Baratz efadcb0390 Add common suite 2016-09-13 16:43:25 -04:00
Adam Baratz 9fb94f03e7 Explicitly allow NULL values for dblib compatibility
MSSQL won't necessarily default columns to NULL, see:
https://msdn.microsoft.com/en-us/library/ms174979.aspx
2016-09-13 16:36:23 -04:00
Adam Baratz 69013f6b26 Add dblib-specific query 2016-09-13 16:36:23 -04:00
Adam Baratz f0a12af65b Remove test cases don't test distinct behavior
These cases are also incompatible with pdo_dblib. Removing is easier.
2016-09-13 16:36:23 -04:00
Adam Baratz 91c49c4ab0 Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions 2016-09-13 16:32:37 -04:00
Adam Baratz 9cdf2042bd Allow \PDO::setAttribute() to set pdo_dblib query timeouts 2016-09-13 16:13:26 -04:00
Jakub Zelenka 3a739c9f9f Merge branch 'PHP-5.6' into PHP-7.0 2016-09-13 18:19:20 +01:00
Jakub Zelenka 05baa92727 Fix bug #73072 (Invalid path SNI_server_certs causes segfault) 2016-09-13 18:15:34 +01:00
Christoph M. Becker c8a9ad1527 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-13 15:59:12 +02:00
Christoph M. Becker c43ecfd798 Merge branch 'pull-request/2126' into PHP-5.6 2016-09-13 15:57:39 +02:00
Anatol Belski 667d8d3522 update NEWS 2016-09-13 15:55:31 +02:00
Anatol Belski 598ed66f82 update NEWS 2016-09-13 15:45:18 +02:00
Anatol Belski 1382e88ac1 upgrade bundled sqlite to 3.14.2 2016-09-13 15:44:21 +02:00
Anatol Belski 5163925796 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test for bug #73068
2016-09-13 15:29:46 +02:00
Anatol Belski 248f8c3a91 add test for bug #73068 2016-09-13 15:28:28 +02:00
Anatol Belski 941b56dd4a update NEWS 2016-09-13 12:34:03 +02:00
Anatol Belski 855b8e4f79 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test portability
2016-09-13 12:02:05 +02:00
Anatol Belski fc31d6fed4 fix test portability 2016-09-13 12:00:29 +02:00
Anatol Belski c403b30291 pick up the safe alloc pieces from
19866fb76c
2016-09-13 11:50:18 +02:00
Anatol Belski 01f6a0a860 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  missed semicolon
  fix C89 conformity
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  Fix test
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Also fix overflow in wordwrap
  Fix bug #73007: add locale length check
  Add more checks for int overflow
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  Fix various int size overflows.
2016-09-13 10:54:54 +02:00
Anatol Belski 8fd0e0285f missed semicolon 2016-09-13 10:50:44 +02:00
Anatol Belski 363c2524dd fix C89 conformity 2016-09-13 10:43:51 +02:00
Stanislav Malyshev 07c6bdb85d Merge branch 'PHP-7.0.11' into PHP-7.0
* PHP-7.0.11: (22 commits)
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  I don't think 8cceb012a7 is needed
  Fix test
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Fix bug #73007: add locale length check
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  sync NEWS
  Revert "Merge branch 'PHP-5.6' into PHP-7.0"
  Merge branch 'PHP-5.6' into PHP-7.0
  Merge branch 'PHP-5.6' into PHP-7.0
  Revert "Revert "Merge branch 'PHP-5.6' into PHP-7.0""
  fix version
  sync NEWS
  Fix bug #72957
  set versions
  ...
2016-09-12 21:09:30 -07:00
Stanislav Malyshev 28f80baf3c Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 33d0ef0fef Fix test 2016-09-12 21:04:23 -07:00
Stanislav Malyshev c4cca4c20e Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c 2016-09-12 21:04:23 -07:00
Stanislav Malyshev f5a9592ad8 Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile) 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 6a7cc8ff85 Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 7381d4c00e Add check in fgetcsv in case sizeof(unit) != sizeof(size_t) 2016-09-12 21:04:23 -07:00
Stanislav Malyshev ecb7f58a06 Fix bug #73029 - Missing type check when unserializing SplArray 2016-09-12 21:04:23 -07:00
Stanislav Malyshev b88393f08a Fix bug #72860: wddx_deserialize use-after-free 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 65c8caafa8 Also fix overflow in wordwrap 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 6d55ba2656 Fix bug #73007: add locale length check 2016-09-12 21:04:23 -07:00
Stanislav Malyshev ba5ac0d360 Add more checks for int overflow 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 223266e4e4 Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Stanislav Malyshev c984661d39 Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 20:28:50 -07:00
Stanislav Malyshev 32e0b46997 I don't think 8cceb012a7 is needed 2016-09-12 20:15:22 -07:00
Stanislav Malyshev fab33740c5 Fix test 2016-09-12 20:15:18 -07:00
Xinchen Hui 2d8ab51576 Fixed bug #73067 (__debugInfo crashes when throwing an exception) 2016-09-13 10:58:57 +08:00
Adam Baratz 2302eef5c9 Never quote values as raw binary data
This reverts a1a18fca6e which was intended to fix
bug #52885. That commit introduced a BC break which wasn't universally
desirable. The issue of quoting binary data (or NVARCHAR strings, or other
nonstandard types) will have to be addressed separately.
2016-09-12 17:32:50 -04:00
Anatol Belski 8cceb012a7 Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
(cherry picked from commit 99ac11222cb2a4e9aa6a865f908b28def349c049)

Conflicts:
	ext/standard/file.c
2016-09-12 18:59:38 +02:00
Adam Baratz 39f45e208c Add myself as pdo_dblib maintainer 2016-09-12 12:43:39 -04:00
Stanislav Malyshev 9528ce7315 Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
(cherry picked from commit bbaf784f8d213e201baf67e861f20b38c6e87d3b)

Conflicts:
	ext/wddx/wddx.c
2016-09-12 18:13:04 +02:00
Stanislav Malyshev c5f34c9eca Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
(cherry picked from commit 75ebf471ff46ec6e5ee279b3650c11d51ebaf9e3)
2016-09-12 17:54:32 +02:00
Stanislav Malyshev 27876d22ef Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
(cherry picked from commit b6e1e5e0b3e6221c7b14fa10cba30f5c5e719e1b)

Conflicts:
	Zend/zend_objects_API.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
2016-09-12 17:53:44 +02:00
Stanislav Malyshev 022e75cba1 Fix bug #73029 - Missing type check when unserializing SplArray
(cherry picked from commit 6d16288150be33392a3249e417a0929881feb9a2)

Conflicts:
	ext/spl/spl_array.c
2016-09-12 17:42:23 +02:00
Stanislav Malyshev 060ab26cfe Fix bug #72860: wddx_deserialize use-after-free
(cherry picked from commit ee552853ff4d72f626102025133e2cd1575043ee)

Conflicts:
	ext/wddx/wddx.c
2016-09-12 17:33:32 +02:00
Stanislav Malyshev 92db16e456 Fix bug #73007: add locale length check
(cherry picked from commit 9e07089626f373d0e7b24b7aeb8b8459aae5f5f8)

Conflicts:
	ext/intl/msgformat/msgformat_format.c
2016-09-12 17:19:47 +02:00
Stanislav Malyshev 0bfb970f43 Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
(cherry picked from commit 19484ab77466f99c78fc0e677f7e03da0584d6a2)
2016-09-12 17:04:19 +02:00
Christoph M. Becker 82fa85fd08 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-12 13:27:57 +02:00
Christoph M. Becker 0cbf634657 Skip regression test for issue that has not yet been released in libgd
<https://github.com/libgd/libgd/issues/177> has been assessed as enhancement,
so most likely it will be released with GD 2.3.
2016-09-12 13:21:34 +02:00
Christoph M. Becker c2044e60f3 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-12 12:39:14 +02:00
Christoph M. Becker fcdc30b347 Skip test for external GD because of not yet published bugfix 2016-09-12 12:34:11 +02:00
Christoph M. Becker c02cfd4e25 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 23:51:32 +02:00
Christoph M. Becker 6d0e773292 Skip tests for unpatched external libgd regarding libvpx
Some issues have never been fixed in the external libgd's libvpx binding,
so we skip the respective tests.
2016-09-11 23:49:09 +02:00
Andrea Faulds d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d22b42d181e15c345f1c59a007b6b58c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00deaa4a3c5026c97580c49c886c72a5b4
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Christoph M. Becker 529811cfb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 19:32:54 +02:00
Christoph M. Becker 6ef987e012 Split test for bundled vs. external libgd
The behavior of imagecropauto($im, IMG_CROP_DEFAULT) is rather different
for the bundled and an external libgd, see
<https://github.com/libgd/libgd/issues/298>.
Therefore we split the test for now.
2016-09-11 19:30:55 +02:00
Christoph M. Becker 225478bccf Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 18:35:11 +02:00
Christoph M. Becker 38455293f7 Make test case more resilient
This test case fails with external libgd, because libgd < 2.2.4 converts
palette images to truecolor (<https://github.com/libgd/libgd/issues/297>).

However, even if there happens no truecolor conversion, it is not guaranteed
that the palette indexes of the original and the cropped image are identical
(this is, for instance, not the case with current libgd master where the bug
has been fixed). Therefore we check for the expected RGBA value instead of
the palette index.
2016-09-11 18:29:27 +02:00
Christoph M. Becker cd16b64f01 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 13:26:30 +02:00
Anatol Belski 95e4e6a3ce fix bug category 2016-09-11 13:20:25 +02:00
Anatol Belski 1b2007dada sync NEWS 2016-09-11 13:19:17 +02:00
Anatol Belski 0fdf2ffae1 update NEWS 2016-09-11 13:05:07 +02:00
Anatol Belski 65bf5e88c7 Revert "Merge branch 'PHP-5.6' into PHP-7.0"
This reverts commit 946335ba70, reversing
changes made to 3437dbfa00.
2016-09-11 12:59:43 +02:00
Christoph M. Becker 2970630133 Merge branch 'PHP-5.6' into PHP-7.0
(cherry picked from commit f93fd8ce32)
2016-09-11 12:59:43 +02:00
Christoph M. Becker 874697e30a Merge branch 'PHP-5.6' into PHP-7.0
(cherry picked from commit 8f32d609c5)
2016-09-11 12:59:43 +02:00
Anatol Belski d947d974d5 Revert "Revert "Merge branch 'PHP-5.6' into PHP-7.0""
This reverts commit 62d5bfb527.
2016-09-11 12:59:43 +02:00
Christoph M. Becker dc09f30933 A picture is worth a thousand message digests
The bundled GD test suites makes heavy use of md5() to verify the result
of drawing operations. This leads to fragile tests (even a slight change
in a PNG header would cause failure, and of course there is the
possibility of collisions), and even worse, eventual test failures are
rather unrevealing.

Therefore we replace all md5() verification with a simplistic
test_image_equals_file(), which is basically a simplified port of libgd's
gdTestImageCompareToFile(), adapted to the needs of PHPTs.

In the long run better tests helpers should be introduced (see also
<http://news.php.net/php.internals/94081>), but for now this solution
is preferable over the former.

(cherry picked from commit 24f9e96792518ec2a75f26b1eb2471dd7694f2b7)
2016-09-11 12:56:53 +02:00
Christoph M. Becker 8753356eb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 00:09:23 +02:00
Christoph M. Becker 326a4e38fb Add regression test for bug #73053
The test succeeds with libxml < 2.9.4, and is supposed to succeed with
libxml > 2.9.4. Unfortunately, we can't conditionally mark a test case
as XFAIL, so we're simply skipping the test for libxml 2.9.4 instead.
2016-09-11 00:06:45 +02:00
Anatol Belski 1ed07676e6 update NEWS 2016-09-10 11:04:00 +02:00
Anatol Belski 1c789dba7b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-09-10 11:03:39 +02:00
Anatol Belski 6c9d37d059 update NEWS 2016-09-10 11:02:17 +02:00
Anatol Belski e539ea439b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Bug #73058 crypt broken when salt is 'too' long
2016-09-10 02:44:21 +02:00
Anatol Belski 669fda00b7 Bug #73058 crypt broken when salt is 'too' long 2016-09-10 02:39:28 +02:00
Nikita Popov e3c08de08a Don't optimize (string) cast on arrays
Otherwise we throw a notice during pass1_5 optimization.
2016-09-09 16:38:26 +02:00
Christoph M. Becker 7a90fc96d8 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-09 16:30:26 +02:00
Christoph M. Becker c42a7f2f3f Remove ignored --FAIL-- section from test case
This is just confusing.
2016-09-09 16:27:50 +02:00
Nikita Popov bbcf77c309 Fix some block_pass bugs 2016-09-09 15:58:36 +02:00
Christoph M. Becker 1a30a7a422 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-09 14:34:11 +02:00
Christoph M. Becker 23e721fc93 Fix #73054: default option ignored when object passed to int filter
If an object that can't be converted to string is validated, we must not
bail out early, but rather check for a requested default value.
2016-09-09 14:30:24 +02:00
Christoph M. Becker 807c49e6be Merge branch 'PHP-5.6' into PHP-7.0 2016-09-09 12:49:02 +02:00
Levi Morrison cb91a51b00 Partially fix bug #67167 - Wrong return value...
...from FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE

The remainer of the fix would require the filter functions to only
convert to string when it makes sense for that particular filter.

(cherry picked from commit 432dc527ad)
2016-09-09 12:45:46 +02:00
Yasuo Ohgaki fb9444e053 Update NEWS 2016-09-09 11:34:34 +09:00
Yasuo Ohgaki 0e3b30fad1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed Bug #68015 Session does not report invalid uid for files save handler
2016-09-09 11:32:20 +09:00
Yasuo Ohgaki 38553e853b Fixed Bug #68015 Session does not report invalid uid for files save handler 2016-09-09 11:31:54 +09:00
Anatol Belski 4fda0a9479 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport 59444347 and 3d7343f6
2016-09-08 17:49:47 +02:00
Anatol Belski b1f33db39f backport 59444347 and 3d7343f6 2016-09-08 17:46:53 +02:00
Yasuo Ohgaki 963454b93f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug26639.phpt
2016-09-08 14:10:21 +09:00
Yasuo Ohgaki 8c700076d7 Fix bug26639.phpt 2016-09-08 14:07:57 +09:00
Yasuo Ohgaki c50ae8fda7 Update NEWS 2016-09-08 13:35:35 +09:00
Yasuo Ohgaki fb1c46f013 Update NEWS 2016-09-08 13:35:30 +09:00
Yasuo Ohgaki 379d9a1cfc Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
2016-09-08 13:32:31 +09:00
Yasuo Ohgaki 8bbd0952e5 Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset 2016-09-08 13:17:10 +09:00
Christoph M. Becker 5880428dac Fix potential memory issue with USE_ZEND_ALLOC=0
The PHP core and extensions are written with the assumption that memory
allocation either succeeds, or the allocator bails out (i.e. the allocator
is infallible). Therefore the result of emalloc() and friends are not checked
for NULL values.

However, with USE_ZEND_ALLOC=0, malloc() and friends are used as allocators,
but these are fallible, i.e. they return NULL instead of bailing out if they
fail. This easily leads to invalid memory accesses in the following, such as
in <https://bugs.php.net/73032>. Some of these cases may constitute
exploitable vulnerabilities.

Therefore we make the infallible __zend_alloc() and friends the default for
USE_ZEND_ALLOC=0.
2016-09-07 22:50:53 +02:00
Christoph M. Becker af3031d755 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-06 12:11:24 +02:00
Christoph M. Becker dad793630d Fix #73025: Heap Buffer Overflow in virtual_popen of zend_virtual_cwd.c
`command_length` is retrieved via strlen() and later passed to emalloc()
and memcpy(), so the appropriate type is `size_t`.

We don't add a regression test, because that would need to allocate a string
of at least 2 GiB.
2016-09-06 12:05:58 +02:00
Yasuo Ohgaki 3a35d43ad9 Update NEWS 2016-09-06 18:29:20 +09:00
Yasuo Ohgaki a58e6d4e34 Update NEWS 2016-09-06 18:28:45 +09:00
Yasuo Ohgaki 6f1a52bfbb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed Bug #66964 mb_convert_variables() cannot detect recursion
2016-09-06 16:41:52 +09:00
Yasuo Ohgaki a25f6f89cd Fixed Bug #66964 mb_convert_variables() cannot detect recursion 2016-09-06 16:05:34 +09:00
Christoph M. Becker 81ec843d0e Merge branch 'PHP-5.6' into PHP-7.0 2016-09-06 01:15:36 +02:00
Christoph M. Becker 8aad3131a1 Fix #70752: Depacking with wrong password leaves 0 length files
We should not open the output stream before we have tried to open the
archive entry, as failing the latter could leave an empty file behind.
2016-09-06 01:03:46 +02:00
Andrea Faulds 009ee6e503 Unbreak FAST_ZPP dead code 2016-09-05 22:12:26 +01:00
Julien Pauli 4fa52b42c7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fixes #72590: Opcache restart with kill_all_lockers does not work
2016-09-05 17:03:51 +02:00
Julien Pauli dd6da58fac Updated NEWS 2016-09-05 17:03:29 +02:00
Keyur 0045d16863 Fixes #72590: Opcache restart with kill_all_lockers does not work
ACCEL_LOG_ERROR is special and causes a zend_bailout() and the code
never gets to call kill() in the next line after the logging. Change
the log level to WARNING.
2016-09-05 16:59:28 +02:00
Nikita Popov 1cd0c80acf Merge branch 'PHP-5.6' into PHP-7.0
[ci skip]
2016-09-05 14:22:29 +02:00
Nikita Popov b92cb6b238 Limit editorconfig to C code
PHPT files do not follow this.

[ci skip]
2016-09-05 14:22:13 +02:00
Julien Pauli d185c2f13a Updated NEWS 2016-09-05 10:18:39 +02:00
Julien Pauli 14d754d6fd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
2016-09-05 10:18:08 +02:00
Julien Pauli 1abbcc8cc5 Updated NEWS 2016-09-05 10:17:56 +02:00
Julien Pauli e5047ac2d2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE
2016-09-05 10:12:49 +02:00
Julien Pauli 9834978a8b Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE 2016-09-05 10:08:42 +02:00
Stanislav Malyshev 4e0605044a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Added editorconfig file
2016-09-05 00:41:23 -07:00
Richard Fussenegger 5c38fbe543 Added editorconfig file 2016-09-05 00:40:58 -07:00
Stanislav Malyshev 92db92c620 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Implement #47456: Missing PCRE option 'J'
2016-09-05 00:38:57 -07:00
Christoph M. Becker 39423e425d Implement #47456: Missing PCRE option 'J'
While it is possible to force the same behavior by setting the internal
option (?J), having a dedicated modifier appears to be useful. After all,
J is even listed on the "Pattern Modifiers" man page[1], but the description
referrs to (?J).

[1] <http://php.net/manual/en/reference.pcre.pattern.modifiers.php>
2016-09-05 00:30:48 -07:00
Stanislav Malyshev b5f9427ca9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:18 -07:00
Stanislav Malyshev cee363d609 Merge branch 'pull-request/2061' into PHP-5.6
* pull-request/2061:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:11 -07:00
Stanislav Malyshev 54f6c8d6df Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Use integer placeholders, since values can vary with the TDS version
2016-09-05 00:19:26 -07:00
Adam Baratz 84d495055d Use integer placeholders, since values can vary with the TDS version 2016-09-05 00:17:59 -07:00
David Carlier 19350b6b73 phpdbg: couple of network function return checks. Possible
overflow when copy the socket_path configuration.
2016-09-04 23:18:51 -07:00
Stanislav Malyshev a2fdf0f413 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Same issue as #72926 in another place.
2016-09-04 20:57:46 -07:00
Stanislav Malyshev b578580e88 Same issue as #72926 in another place. 2016-09-04 20:49:34 -07:00
Stanislav Malyshev c3dfe57c23 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Sync fix for bug #72910 with current upstream
2016-09-04 19:15:30 -07:00
Stanislav Malyshev d1fbc98ff6 Sync fix for bug #72910 with current upstream 2016-09-04 19:13:48 -07:00
Christoph M. Becker 7f97d63130 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-04 16:39:45 +02:00
Christoph M. Becker b7259b71b4 Fix #72994: mbc_to_code() out of bounds read
We're backporting commit 999a3553 to the still supported PHP 5.6.
2016-09-04 16:37:06 +02:00
Nikita Popov 1ae2d074f8 Fix bug #72996 2016-09-03 23:30:23 +02:00
Christoph M. Becker 8cc9570f53 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-03 19:59:44 +02:00
Christoph M. Becker d582241368 Fix #67325: imagetruecolortopalette: white is duplicated in palette
gdImageTrueColorToPalette() is sometimes wasteful by putting multiple white
color entries into the palette. This is caused by an obvious typo, where
to avoid a division by zero when `total` is zero, `count` is checked instead
of `total`.

We fix this issue to improve the quality of the color quantization.

Cf. <https://github.com/libgd/libgd/commit/24b4550f>
2016-09-03 19:50:42 +02:00
Anatol Belski c9040d43a8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak and error check order
2016-09-03 17:03:55 +02:00
Anatol Belski 9513187dee fix leak and error check order 2016-09-03 16:59:17 +02:00
Christoph M. Becker 0bc7e0c0ce Merge branch 'PHP-5.6' into PHP-7.0 2016-09-03 13:46:03 +02:00
Christoph M. Becker bca913d70a Fix proto comment
While we're at it, we also change a related comment to use American English
consistently.
2016-09-03 13:41:29 +02:00
Christoph M. Becker f3dc00fdfb Merge branch 'PHP-5.6' into PHP-7.0 2016-09-03 00:30:05 +02:00
Christoph M. Becker c83bdb8e6a Make test case more resilient
When ran from a root directory the test case failed, because the open_basedir
restriction for "../[…]" won't kick in. Therefore we change the current
working directory to the test case's directory, as discussed on internals,
see <http://news.php.net/php.internals/95585>.
2016-09-03 00:24:30 +02:00
Anatol Belski 7483acf511 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix double free
2016-09-03 00:05:02 +02:00
Anatol Belski 5efd2a33df fix double free 2016-09-03 00:01:04 +02:00
Julien Pauli e14b14d026 Fix warning about sign-mismatch comparisons 2016-09-02 17:01:52 +02:00
Stanislav Malyshev ccc8d92d3d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72910
  5.6.27 will be next
2016-09-01 23:28:44 -07:00
Stanislav Malyshev e576714f6b Fix bug #72910
Merge upstream patch from https://github.com/kkos/oniguruma/commit/65bdf2a0d160d06556415e5f396a75f6b11bad5c
2016-09-01 23:27:06 -07:00
Ferenc Kovacs fbb81dd755 5.6.27 will be next 2016-09-01 20:27:19 +02:00
Xinchen Hui 1ee41683dc Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp() function) 2016-09-01 12:10:38 +08:00
Yasuo Ohgaki cc797d4fc3 Fix bug #72940 properly. Reduce needless branches 2016-09-01 07:47:13 +09:00
Christoph M. Becker f93fd8ce32 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 16:38:38 +02:00
Christoph M. Becker b2d267d9ee Fix #71882 amendment 2: Negative ftruncate() on php://memory exhausts memory 2016-08-31 16:33:14 +02:00
Christoph M. Becker 8f32d609c5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 14:53:53 +02:00
Christoph M. Becker 314a9f8553 Fix #71882 amendment: Negative ftruncate() on php://memory exhausts memory
To avoid BC breaks, we do not raise a warning for now.
2016-08-31 14:51:37 +02:00
Yasuo Ohgaki 97f2bb894a Update NEWS 2016-08-31 21:10:57 +09:00
Yasuo Ohgaki 747b61808b Update NEWS 2016-08-31 21:06:19 +09:00
Anatol Belski ed51f34795 fix version 2016-08-30 18:37:43 +02:00
Nikita Popov 3317287ce1 Fix bug #71711
Also handle another case of bug #71996.
2016-08-30 18:06:18 +02:00
Nikita Popov 8e487aefaa Fixed bug #71996 2016-08-30 17:20:55 +02:00
Christoph M. Becker 972302d2f0 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 15:01:12 +02:00
Christoph M. Becker 2f10db36af Fix #66797: mb_substr only takes 32-bit signed integer
`from` and `len` are `long`, but get passed to mbfl_substr() which expects
`int`s. Therefore we clamp the values to avoid the undefined conversion
behavior.
2016-08-30 14:52:47 +02:00
Anatol Belski 52afd8b744 fix typo 2016-08-30 14:11:47 +02:00
Anatol Belski bc7460260b prepare for next 2016-08-30 14:11:22 +02:00
Nikita Popov 2c12a5f0a8 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 13:44:59 +02:00
Ville Hukkamäki af7828a20f Test case for bug #72771 2016-08-30 13:44:34 +02:00
Anatol Belski 119744fc22 sync NEWS 2016-08-30 13:39:27 +02:00
Nikita Popov 345b96c4a3 Fix bug #72957
(cherry picked from commit bfd4277008)
2016-08-30 13:38:54 +02:00
Nikita Popov bfd4277008 Fix bug #72957 2016-08-30 13:05:53 +02:00
Nikita Popov 6adb7e0b7a Followup for bug #72971
Property writes did not respect the namespace either. This is an
incomplete fix in that it only handles the case where an existing
child element is modified, not when a new one is created.
2016-08-30 12:53:50 +02:00
Anatol Belski f6d02733fd set versions 2016-08-30 12:11:22 +02:00
Anatol Belski 191ff3d995 sync NEWS 2016-08-30 12:07:51 +02:00
Anatol Belski 62d5bfb527 Revert "Merge branch 'PHP-5.6' into PHP-7.0"
This reverts commit 65f0c163f9, reversing
changes made to 4b45c0a9a7.
2016-08-30 12:06:46 +02:00
Nikita Popov 07cc6a6ba2 Fix bug #72971 2016-08-30 10:54:31 +02:00
Yasuo Ohgaki b5f2f6fbd8 Fixed bug #72940 SID always return "name=ID", even if session cookie exist 2016-08-30 15:58:25 +09:00
Christoph M. Becker 65f0c163f9 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 02:13:48 +02:00
Christoph M. Becker 207dab585a Fix #71882: Negative ftruncate() on php://memory exhausts memory
We must not pass negative sizes to a size_t parameter.
2016-08-30 02:05:45 +02:00
Christoph M. Becker 4b45c0a9a7 Merge branch 'pull-request/2043' into PHP-7.0 2016-08-30 01:16:45 +02:00
Anatol Belski 1b227de970 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix HANDLE leak
2016-08-29 21:47:54 +02:00
Anatol Belski c7b4cd1a51 fix HANDLE leak 2016-08-29 21:45:39 +02:00
Anatol Belski 5bcae9d586 update NEWS 2016-08-29 21:23:20 +02:00
Anatol Belski b6b7696114 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-08-29 21:22:43 +02:00
Anatol Belski ae81e8fc32 update NEWS 2016-08-29 21:20:36 +02:00
Anatol Belski 2004585d03 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  ensure null termination
2016-08-29 21:13:39 +02:00
Anatol Belski d787b0ea13 ensure null termination 2016-08-29 21:03:03 +02:00
Anatol Belski 946335ba70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify
2016-08-29 20:32:55 +02:00
Anatol Belski 295303b590 Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify 2016-08-29 20:25:34 +02:00
Anatol Belski 3437dbfa00 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix double free
2016-08-29 19:33:22 +02:00
Anatol Belski 1a840b9af0 fix double free 2016-08-29 19:27:47 +02:00
Anatol Belski 1d93086937 fix double free 2016-08-29 18:56:25 +02:00
Anatol Belski ca4eeedd36 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-08-29 18:05:47 +02:00
Anatol Belski e2609a38d9 fix leak 2016-08-29 18:01:21 +02:00
Anatol Belski d80a317c0b fix leak 2016-08-29 15:43:10 +02:00
Anatol Belski 1d7ec685c1 fix possible memory leak 2016-08-29 15:28:09 +02:00
Anatol Belski eac7f4b670 fix dealloc mismatch 2016-08-29 12:46:23 +02:00
Dmitry Stogov b66039db33 Fixed bug #72944 (Null pointer deref in zval_delref_p). 2016-08-29 12:02:50 +03:00
George Wang ca1eb585ee Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	sapi/litespeed/lsapi_main.c
2016-08-28 22:23:28 -04:00
George Wang c73bcbefbd Added .user.ini support.
Added LSPHPRC support.
update LiteSpeed SAPI version to 6.10 .
2016-08-28 21:49:30 -04:00
Xinchen Hui 986d0f87ec Fixed bug #72936 (Zend API's zend_symtable_str_update() asserts key should end with '\0') 2016-08-29 00:10:31 +08:00
Christoph M. Becker 8fcfacf746 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-27 01:18:10 +02:00
Christoph M. Becker 2139918ea6 Fix #65550: get_browser() incorrectly parsers entries with "+" sign
+ signs in the browscap patterns are meant to be literal characters, so we
have to escape them for the regex matching.
2016-08-27 01:12:01 +02:00
Christoph M. Becker c4c3eb55a7 Fix #72949: Typo in opcache error message 2016-08-26 18:50:30 +02:00
Xinchen Hui c67fa3c91d Fixed bug #72943 (assign_dim on string doesn't reset hval) 2016-08-26 18:30:08 +08:00
Anatol Belski 57509fb969 update NEWS 2016-08-25 19:43:39 +02:00
Alexander Zhuravlev a000bff2c3 pdo_dblib: stringify uniqidentifier field
Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

pdo_dblib: Stringify uniqidentifier field

Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

Tests added.

pdo_dblib: Stringify uniqidentifier field

Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

Tests fix.

pdo_dblib: Stringify uniqueidentifier field Added separate PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER attribute instead of PDO::ATTR_STRINGIFY_FETCHES.

pdo_dblib: Stringify uniqueidentifier field Added `getAttribute` support for PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER.

Simplify storage of stringify_uniqueidentifier attribute
2016-08-25 19:37:21 +02:00
Christoph M. Becker 433976f931 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-25 18:29:23 +02:00
Christoph M. Becker 84512a1177 Fix #70825: Cannot fetch multiple values with group in ini file
If we have the position already from the last fetch, we also have to preset
the current group, because it won't be read again.
2016-08-25 18:18:10 +02:00
Anatol Belski 51d19c12a5 fix check for args by ref 2016-08-25 18:06:47 +02:00
Christoph M. Becker 5f6a1d1472 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-25 16:22:57 +02:00
Christoph M. Becker bd8112afe0 Fix #71514: Bad dba_replace condition because of wrong API usage
We're backporting commit 9e309a2d to PHP-5.6, because it is a bugfix.
2016-08-25 16:20:30 +02:00
Anatol Belski d3058a69d8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport relevant part from bug #72858 patch in 7.0
2016-08-25 12:52:29 +02:00
Anatol Belski a1ff39ffe5 backport relevant part from bug #72858 patch in 7.0 2016-08-25 12:46:28 +02:00
Anatol Belski 392c5ea472 Fixed bug #72922 COM called from PHP does not return out parameters 2016-08-25 12:12:45 +02:00
Christoph M. Becker 4c13a7f5c4 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 19:48:38 +02:00
Christoph M. Becker 6a232c3604 Fix #68716: possible resource leaks in _php_image_convert()
We properly clean up after ourselves wrt. to closing opened file pointers
and created images.
2016-08-21 19:39:58 +02:00
Christoph M. Becker 4c68fc5392 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 17:45:49 +02:00
Christoph M. Becker d65adac2be Fix #72913: imagecopy() loses single-color transparency on palette images
The proper code to handle true-color to palette copies is already contained
in gdImageCopy(), so we can simply remove the buggy duplicated code.
2016-08-21 17:39:23 +02:00
Christoph M. Becker 7a36056d6c Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 16:15:22 +02:00
Christoph M. Becker 9eb5bbd8bd Fix #66005: imagecopy does not support 1bit transparency on truecolor images
We must not copy transparent pixels, see
<https://github.com/libgd/libgd/commit/daac285c>.
2016-08-21 16:08:57 +02:00
Xinchen Hui 0476bb1de5 Fixed bug #72911 (Memleak in zend_binary_assign_op_obj_helper) 2016-08-21 17:38:03 +08:00
Xinchen Hui 17e8a3df13 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260))
2016-08-21 17:19:36 +08:00
Xinchen Hui 226e21b0fe Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:/php-src:
  Improvements to fix #72714, suggested by nikic
  Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
  Fix #72714: _xml_startElementHandler() segmentation fault
  update NEWS
  Fixed bug #72852 imap_mail null dereference
  Revert "Fix dba configuration for Windows"
  Fix dba configuration for Windows
  Fix broken test include
  fix NEWS
  Add myself as PDO_OCI maintainer
2016-08-21 17:19:24 +08:00
Xinchen Hui b740bb3987 Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260)) 2016-08-21 17:10:10 +08:00
Christoph M. Becker 39172d44d8 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 12:46:08 +02:00
Christoph M. Becker 52793c14d9 Improvements to fix #72714, suggested by nikic 2016-08-20 12:44:20 +02:00
Christoph M. Becker 078f674212 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 03:04:08 +02:00
Christoph M. Becker e4a006cd3e Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
According to the Unicode specification (at least as of 5.1), CRLF sequences
are considered to be a single grapheme. We cater to that special case by
letting grapheme_ascii_check() fail. While it would be trivial to fix
grapheme_ascii_check() wrt. grapheme_strlen(), grapheme_substr() and
grapheme_strrpos() would be much harder to handle, so we accept the slight
performance penalty if CRLF is involved.
2016-08-20 03:01:35 +02:00
Christoph M. Becker db1ef5cb00 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 02:14:49 +02:00
Christoph M. Becker 9164dc11e2 Fix #72714: _xml_startElementHandler() segmentation fault
The issue is caused by an integer overflow when the `long` passed as
XML_OPTION_SKIP_TAGSTART is assigned to `xml_parser::toffset` which is
declared as `int`. We can simply work around this issue, by clipping
resulting negative values to 0 (and raising a notice in this case), because
the reasonable range for this value is certainly catered to by positive
`int`s.

However, there still remains the issue that `xml_parser::toffset` is later
added to `char *`s, which can cause OOB reads, so we make sure that the
upper bound never exceeds the strlen(). We eschew optimizing `SKIP_TAGSTART`
wrt. to the potentially duplicate strlen() call, because that code path is
unexpected anyway.
2016-08-20 01:58:08 +02:00
Anatol Belski a556543a3f update NEWS 2016-08-20 01:38:01 +02:00
Anatol Belski a569b8816b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fixed bug #72852 imap_mail null dereference
2016-08-20 01:37:26 +02:00
Anatol Belski f682193609 update NEWS 2016-08-20 01:36:37 +02:00
Anatol Belski 21f08a7488 Fixed bug #72852 imap_mail null dereference 2016-08-20 01:34:46 +02:00
Christoph M. Becker 61344c6d66 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-19 16:38:53 +02:00
Christoph M. Becker 057278b759 Revert "Fix dba configuration for Windows"
This reverts commit ad76e8a529.

After a discussion with Anatol it seems to be better QA wise to not make
this change in stable versions or betas.
2016-08-19 16:35:31 +02:00
Anatol Belski 2d123a916d Improve fix for bug #72837 2016-08-19 12:50:32 +02:00
Christoph M. Becker 4df85466b6 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-19 11:47:42 +02:00
Christoph M. Becker ad76e8a529 Fix dba configuration for Windows
To be able to build the dba extension on Windows, libdb was required. This
is contrary to *nix where each handler can be configured individually. To
avoid BC breaks, we only do minimal modifications, instead of adjusting the
Windows configuration to match the *nix configuration, for now.
2016-08-19 11:42:16 +02:00
Christoph M. Becker caf0ad403d Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 17:56:16 +02:00
Christoph M. Becker bc1214f25e Fix broken test include
To avoid that the test stalls, we must always use `t` mode.
2016-08-18 17:53:57 +02:00
Anatol Belski e6d3221766 update NEWS 2016-08-18 17:50:17 +02:00
Anatol Belski 98d8794eae avoid other efforts if memory mapping fails 2016-08-18 15:58:33 +02:00
Anatol Belski 91cd55e32a fix test 2016-08-18 15:35:26 +02:00
Anatol Belski 67f8c14c29 Fixed bug #72858 shm_attach null dereference 2016-08-18 14:15:10 +02:00
Ferenc Kovacs 7ecd4bb0a4 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 13:03:14 +02:00
Ferenc Kovacs 761d2f629b fix NEWS 2016-08-18 13:01:53 +02:00
Christopher Jones 127b42f9b3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 15:47:36 +10:00
Christopher Jones f2d5305097 Add myself as PDO_OCI maintainer 2016-08-18 15:47:25 +10:00
Christopher Jones cb34882e61 Prepare for OCI8 PECL release 2016-08-18 13:58:24 +10:00
Christopher Jones b12ac316eb Prepare for OCI8 PECL release 2016-08-18 13:50:36 +10:00
Anatol Belski 52787e902f sync NEWS 2016-08-18 00:15:54 +02:00
Christoph M. Becker 9fa0009702 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 22:12:01 +02:00
Christoph M. Becker 54293d21cb Skip tests that are supposed to fail due to bugs in old external libgd 2016-08-17 21:36:26 +02:00
Christoph M. Becker 1bc9ea4f10 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 18:13:41 +02:00
Christoph M. Becker a3159d29bb Make tests a little more resilient
PNG allows identical images to be stored differently what makes nearly all
tests checking the MD5 hash of the PNG representation fail with external
libgd. For now, we use the GD format instead, which doesn't allow for such
differences.

Of course, this md5() checking should be replaced by a image diffing feature
in the long run.
2016-08-17 17:59:33 +02:00
Kalle Sommer Nielsen 1e4cae28b2 Seems like I did a bad merge earlier, this should make PHP-7.0 sync with 7.1/master properly now 2016-08-17 16:34:22 +02:00
Kalle Sommer Nielsen 8a1fbdda43 Fixed C89 build 2016-08-17 13:43:50 +02:00
Anatol Belski 06c0540b90 fix char * vs zend_string * 2016-08-17 13:22:02 +02:00
Christoph M. Becker 356b586ec1 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 12:47:06 +02:00
Christoph M. Becker 48198e4c25 Fix #68302: impossible to compile php with zip support
We should not let configure succeed, if SIZEOF_OFF_T == 0, just to let the
compilation fail later. Instead we bail out early, giving a hint regarding
the potential issue, namely misconfigured libraries.
2016-08-17 12:43:29 +02:00
Anatol Belski 05c8a0771d fix tests
The 70436 test is just a bonus for the hardening in 72633.
2016-08-17 12:39:35 +02:00
Xinchen Hui 195d7618e7 Avoid duplicating string 2016-08-17 18:19:14 +08:00
Anatol Belski 7d4c5a0dc9 Revert "fix tests"
This reverts commit a47df5be19.

Looks like some environment issue, as some system throws the notice,
some don't. Revert for now.
2016-08-17 12:04:03 +02:00
Anatol Belski a5d00fc908 fix leak 2016-08-17 11:51:56 +02:00
Xinchen Hui 1dab8e07f2 Update NEWs 2016-08-17 16:56:58 +08:00
Xinchen Hui b172f43caa Unused label 2016-08-17 16:56:20 +08:00
Xinchen Hui 3956deb1b2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72853 (stream_set_blocking doesn't work)

Conflicts:
	main/streams/plain_wrapper.c
2016-08-17 16:56:02 +08:00
Xinchen Hui abe00908af Fixed bug #72853 (stream_set_blocking doesn't work)
Implemented  PHP_STREAM_OPTION_META_DATA_API for plain_wrappers
2016-08-17 16:54:21 +08:00
Stanislav Malyshev ed9d916c28 fix test 2016-08-17 01:12:33 -07:00
Nikita Popov e0f9fbdfa6 Bug #72663 - part 3
When using the php_serialize session serialization handler, do
not use the result of the unserialization if it failed.
2016-08-17 01:01:03 -07:00
Nikita Popov 61f2f5a0f7 Bug #72663 - part 2
If a (nested) unserialize() call fails, we remove all the values
that were inserted into var_hash during that call. This prevents
their use in other unserializations in the same context.
2016-08-17 00:47:02 -07:00
Nikita Popov 2135fdef9b Bug #72663 - part 1
Don't call __destruct() on an unserialized object that has a
__wakeup() method if either
a) unserialization of its properties fails or
b) the __wakeup() call fails (e.g. by throwing).

This basically treats __wakeup() as a form of constructor and
aligns us with the usual behavior that if the constructor call
fails the destructor should not be called.

The security aspect here is that people use __wakeup() to prevent
unserialization of objects with dangerous __destruct() methods,
but this is ineffective if __destruct() can still be called while
__wakeup() was skipped.
2016-08-17 00:45:57 -07:00
Stanislav Malyshev 0d13325b66 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: (24 commits)
  Update NEWS
  BLock test with memory leak
  fix tests
  Fix TSRM build
  Fix bug #72850 - integer overflow in uuencode
  Fixed bug #72849 - integer overflow in urlencode
  Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption
  Fix bug #72838 - 	Integer overflow lead to heap corruption in sql_regcase
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72836 - integer overflow in base64_decode caused heap corruption
  Fix for bug #72807 - do not produce strings with negative length
  Fix for bug #72790 and bug #72799
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  Fix bug#72697 - select_colors write out-of-bounds
  Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
  Fix bug #72750: wddx_deserialize null dereference
  Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack
  Improve fix for #72663
  Fix bug #70436: Use After Free Vulnerability in unserialize()
  Fix bug #72749: wddx_deserialize allows illegal memory access
  ...

Conflicts:
	Zend/zend_API.h
	ext/bz2/bz2.c
	ext/curl/interface.c
	ext/ereg/ereg.c
	ext/exif/exif.c
	ext/gd/gd.c
	ext/gd/tests/imagetruecolortopalette_error3.phpt
	ext/gd/tests/imagetruecolortopalette_error4.phpt
	ext/session/session.c
	ext/snmp/snmp.c
	ext/standard/base64.c
	ext/standard/ftp_fopen_wrapper.c
	ext/standard/quot_print.c
	ext/standard/url.c
	ext/standard/uuencode.c
	ext/standard/var.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/wddx/tests/bug72790.phpt
	ext/wddx/tests/bug72799.phpt
	ext/wddx/wddx.c
	sapi/cli/generate_mime_type_map.php
2016-08-17 00:43:33 -07:00
Stanislav Malyshev 75d7666968 Merge branch 'PHP-7.0.10' into PHP-7.0
* PHP-7.0.10:
  Fix bug #72749: wddx_deserialize allows illegal memory access
  Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
  fix tests
  Fix bug#72697 - select_colors write out-of-bounds
  Fix bug #72708 - php_snmp_parse_oid integer overflow in memory allocation
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  Fix bug #72750: wddx_deserialize null dereference
  Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack
  fix tests
  add missing skipif section
  Fix for bug #72790 and bug #72799
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72742 - memory allocator fails to realloc small block to large one
  Use size_t for path length
  Check for string overflow
  Fix for bug #72782: mcrypt accepts only ints, so don't pass anything else
  Fix bug #72674 - check both curl_escape and curl_unescape
2016-08-16 23:52:22 -07:00
Stanislav Malyshev f8a75d4eee Merge branch 'PHP-7.0' into PHP-7.0.10
* PHP-7.0: (34 commits)
  Fix URL rewriter partially
  Support "git worktree"
  Add NEWS
  Fix ASSERT logic
  Bugfix 72791: fix memory leak in PDO persistent connections
  Don't copy mime types in CLI server
  Remove obsolete Id tags
  Bump version in OCI8 test
  Fixed bug #72788 (Invalid memory access when using persistent PDO connection)
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
  Replace dead branch with ZEND_ASSERT()
  Add test for bug #69107: finfo no longer detects PHP files
  Fix bug #55451
  Fix stream_socket_enable_crypto() test
  Remove old $Id$ tags
  Sync with 7.1 branch changes from Nikita & Dimitri to keep OCI8 code identical
  Fix bug #72524 (Binding null values triggers ORA-24816 error)
  Fix the fix (Nikita), thanks!
  Check the return value of dbconvert() in mssql_guid_string(), as it may return -1 in case the conversion failed. In that case false is returned.
  ...

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-16 23:50:42 -07:00
Stanislav Malyshev 9e00ad2b09 Update NEWS 2016-08-16 23:44:59 -07:00
Stanislav Malyshev 4bf5c3187f BLock test with memory leak 2016-08-16 22:55:44 -07:00
Stanislav Malyshev d8b2de164e fix tests 2016-08-16 22:55:43 -07:00
Stanislav Malyshev 40bd921cea Fix TSRM build 2016-08-16 22:55:43 -07:00
Stanislav Malyshev 35a8ed2f62 Fix bug #72850 - integer overflow in uuencode 2016-08-16 22:55:43 -07:00
Stanislav Malyshev b9e81e5844 Fixed bug #72849 - integer overflow in urlencode 2016-08-16 22:55:42 -07:00
Stanislav Malyshev 24d741d376 Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption 2016-08-16 22:55:42 -07:00
Stanislav Malyshev 5f91f692c3 Fix bug #72838 - Integer overflow lead to heap corruption in sql_regcase 2016-08-16 22:55:42 -07:00
Stanislav Malyshev cfdeedd985 Fix bug #72837 - integer overflow in bzdecompress caused heap corruption 2016-08-16 22:55:41 -07:00
Stanislav Malyshev d6a43a8562 Fix bug #72836 - integer overflow in base64_decode caused heap corruption 2016-08-16 22:55:41 -07:00
Stanislav Malyshev 1cd6bc6463 Fix for bug #72807 - do not produce strings with negative length 2016-08-16 22:55:41 -07:00
Stanislav Malyshev 5a34bd6d1e Fix for bug #72790 and bug #72799 2016-08-16 22:55:41 -07:00
Stanislav Malyshev 1bd103df00 Fix bug #72730 - imagegammacorrect allows arbitrary write access 2016-08-16 22:55:40 -07:00
Stanislav Malyshev a3598dd7c9 Fix bug#72697 - select_colors write out-of-bounds 2016-08-16 22:55:40 -07:00
Stanislav Malyshev 6dbb1ee46b Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF 2016-08-16 22:55:40 -07:00
Stanislav Malyshev 698a691724 Fix bug #72750: wddx_deserialize null dereference 2016-08-16 22:55:39 -07:00
Stanislav Malyshev e018ff094f Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack 2016-08-16 22:55:39 -07:00
Stanislav Malyshev 639f7fde6a Improve fix for #72663 2016-08-16 22:55:20 -07:00
Stanislav Malyshev 95d09e4b5e Fix bug #70436: Use After Free Vulnerability in unserialize() 2016-08-16 22:55:20 -07:00
Stanislav Malyshev 426aeb2808 Fix bug #72749: wddx_deserialize allows illegal memory access 2016-08-16 22:55:19 -07:00
Stanislav Malyshev f1a0b7d690 Update comment 2016-08-16 22:55:19 -07:00
Stanislav Malyshev da316b50bd Fix bug #72708 - php_snmp_parse_oid integer overflow in memory allocation 2016-08-16 22:55:19 -07:00
Stanislav Malyshev 8763c6090d Fix bug #72681 - consume data even if we're not storing them 2016-08-16 22:54:42 -07:00
Stanislav Malyshev 448c9be157 Fix bug #72663 - destroy broken object when unserializing 2016-08-16 22:54:42 -07:00
Xinchen Hui f3231a7c76 Unused var 2016-08-17 11:16:48 +08:00
Anatol Belski 0f337e11bc update NEWS 2016-08-17 01:37:40 +02:00
Christoph M. Becker 6202b47e63 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 01:22:11 +02:00
Anatol Belski 20f76efb78 fix test 2016-08-17 00:56:19 +02:00
Anatol Belski 6de67244d4 fix blocking pipe stream option value
As revealed by #72857, this value conflicts with the xport option.
Wrong code can otherwise cause streams misbehave, fe if local and
network streams APIs are mixed.
2016-08-17 00:53:15 +02:00
Christoph M. Becker 1bb92d5212 #72085: SEGV on unknown address zif_xml_parse
We better make sure that the ZVALs we're accessing as arrays are indeed
arrays.
2016-08-17 00:42:45 +02:00
Stanislav Malyshev e3829b8869 Fix bug #72749: wddx_deserialize allows illegal memory access
(cherry picked from commit 659a21dc20f0b64dafd8cb16573059d3b45cce6b)

Conflicts:
	ext/wddx/wddx.c
2016-08-16 23:36:14 +02:00
Anatol Belski f18f394386 fix test cleanup 2016-08-16 22:54:51 +02:00
Anatol Belski 5391bb8be0 Fixed #72857 stream_socket_recvfrom read access violation 2016-08-16 22:47:50 +02:00
Nikita Popov e2230c17d3 Fix bug #72854 2016-08-16 21:05:30 +02:00
Stanislav Malyshev 24fb60ffe9 Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
(cherry picked from commit 620b01337cc39f856ca68c34c35e154f5f0682fc)

Conflicts:
	ext/exif/exif.c
2016-08-16 15:04:16 +02:00
Anatol Belski d926a48fd2 fix tests 2016-08-16 14:41:24 +02:00
Anatol Belski 28022c9b1f Fix bug#72697 - select_colors write out-of-bounds
(cherry picked from commit b6f13a5ef9d6280cf984826a5de012a32c396cd4)

Conflicts:
	ext/gd/gd.c
2016-08-16 14:37:39 +02:00
Stanislav Malyshev b735a4419c Fix bug #72708 - php_snmp_parse_oid integer overflow in memory allocation
(cherry picked from commit c3f6d6da100c6451a540680504de4105b8bed83c)

Conflicts:
	ext/snmp/snmp.c
	main/php_version.h
2016-08-16 14:22:10 +02:00
Stanislav Malyshev e70069a62f Fix bug #72730 - imagegammacorrect allows arbitrary write access
(cherry picked from commit 047fe0ed03093a496691d376fcf51a7e2f1d04b0)

Conflicts:
	ext/gd/gd.c
2016-08-16 14:14:03 +02:00
Stanislav Malyshev f1486f0fd6 Fix bug #72750: wddx_deserialize null dereference
(cherry picked from commit 6930a1d12c47aa1d2675837852910d177b0ceb11)

Conflicts:
	ext/wddx/wddx.c
2016-08-16 13:13:05 +02:00
Anatol Belski e5b0952be2 Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack
(cherry picked from commit f9c2edb4dbc01a817989b70ca7726f177bb1a103)

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-16 13:08:24 +02:00
Anatol Belski a47df5be19 fix tests 2016-08-16 13:01:06 +02:00
Anatol Belski 4bccb8e94e add missing skipif section 2016-08-16 12:53:40 +02:00
Stanislav Malyshev 0c8a2a2cd1 Fix for bug #72790 and bug #72799
(cherry picked from commit a14fdb9746262549bbbb96abb87338bacd147e1b)

Conflicts:
	ext/wddx/wddx.c
2016-08-16 12:46:29 +02:00
Anatol Belski 67d0fe39ee Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
Conflicts:
	ext/bz2/bz2.c
2016-08-16 12:34:25 +02:00
Dmitry Stogov ff06588130 Fixed use after free 2016-08-16 11:44:22 +03:00
Christopher Jones 51c1b64fa9 Remove unused OCI8 macros 2016-08-16 16:58:20 +10:00
Xinchen Hui 60de74ebda Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN) 2016-08-15 23:22:55 +08:00
Stanislav Malyshev c2a13ced42 Fix bug #72742 - memory allocator fails to realloc small block to large one 2016-08-14 19:08:59 -07:00
Anatol Belski d6b46901b2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  put missing prototype and fix ts build
2016-08-14 22:39:01 +02:00
Anatol Belski 4a4422740f put missing prototype and fix ts build 2016-08-14 22:35:01 +02:00
Anatol Belski e910b0a8a5 update NEWS 2016-08-14 20:52:47 +02:00
Anatol Belski 9088ef8052 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-08-14 20:51:44 +02:00
Anatol Belski 5c7f802e7e update NEWS 2016-08-14 20:50:23 +02:00
Anatol Belski 245eaf5187 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72759 Regression in pgo_pgsql
2016-08-14 20:04:49 +02:00
Anatol Belski 977cbc2fff Fixed bug #72759 Regression in pgo_pgsql
This is caused by the fix for #72633. Namely, lastval() throws an error,
if no nextval() was called earlier in the same session. This is by all
means correct so far, however inside a transaction it leads to an abort.
This is the opposite to MySQL's last_insert_id() which doesn't produce
any error no matter something were autoincremented or not.

To avoid existing scripts breakage in the stable branches, the previous
patch is extended to revert the transaction to the state before the lastval()
call in case of error. It is done only for 5.6 and 7.0 to retain BC. For 7.1+,
the clean behavior should persist. This is already the current behavior, when
the sequence name is explicitly passed. So there's no reason to obfuscate the
errors where this breakage is valid.
2016-08-14 19:33:24 +02:00
Jakub Zelenka 436d50a821 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-14 14:00:35 +01:00
Jakub Zelenka 9f1d962ed6 Fixed bug #72787 (json_decode reads out of bounds) 2016-08-14 13:52:59 +01:00
Nikita Popov 98787d9002 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 21:41:00 +02:00
Benedict Singer dfadc5a427 Bug 70195
Many FTP-S servers now require FTP clients to re-use the SSL session
from the control connection on the data connection, to prove that the
same entity controls both connections. This patch updates PHP's FTP-S
client code to allow that possibility.
2016-08-13 21:35:03 +02:00
Christoph M. Becker 33508a3d47 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 16:23:15 +02:00
Christoph M. Becker 82df4e2638 Fix #72278: getimagesize returning FALSE on valid jpg
getimagesize() is rather strict about the length of the marker payload data,
and fails if there are extraneous bytes before the next marker. Only a very
special case reported in bug #13213 is catered to.

libjpeg is rather resilient to such corrupted JPEG files, and raises a
recoverable error in this case. Other image processors also accept such
JPEG files, so we adapt getimagesize() to skip (but warn about) such
extraneous bytes.
2016-08-13 16:14:34 +02:00
Christoph M. Becker a93c62aafa Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 11:47:20 +02:00
Christoph M. Becker ae3b2078ea Fix #72823: strtr out-of-bound access
If php_strtr_array_prepare_repls() reports pattern_len == 0, we return
early to avoid OOB accesses, and because there is nothing to replace anyway.
2016-08-13 11:40:33 +02:00
Christoph M. Becker 175d94b6e5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 01:21:57 +02:00
Christoph M. Becker 7938ebf6c1 Fix #60665: call to empty() on NULL result using PDO::FETCH_LAZY returns false
The has_property handler only checked whether a respective column name
exists, but neither whether the column value is set, nor whether it is
empty, respectively. We fix that to match the behavior of POD:FETCH_OBJ in
particular and PHP in general.
2016-08-13 01:11:13 +02:00
Christoph M. Becker 92a076a92b Fix #72793: xml_parser_free leaks mem when execute xml_set_object 2016-08-12 12:54:21 +02:00
Xinchen Hui fe41f87e46 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix URL rewriter partially
  Support "git worktree"
2016-08-12 16:25:18 +08:00
Xinchen Hui e03480bfab Fixed bug #72813 (Segfault with __get returned by ref)
This should be safe change, as we don't dereference value and member
after calling setter/getter.

And compare to adding unref codes, this is much cheaper.
2016-08-12 16:24:46 +08:00
Stanislav Malyshev 6304a611cd Use size_t for path length 2016-08-10 23:46:58 -07:00
Stanislav Malyshev 7bf6d98535 Check for string overflow 2016-08-10 23:46:33 -07:00
Stanislav Malyshev 4f6a97f532 Fix for bug #72782: mcrypt accepts only ints, so don't pass anything else 2016-08-10 22:39:03 -07:00
Yasuo Ohgaki ae3782a0db Fix URL rewriter partially 2016-08-11 09:18:47 +09:00
Yasuo Ohgaki f19578ad58 Fix URL rewriter partially 2016-08-11 09:18:33 +09:00
Yasuo Ohgaki 5bf14e4699 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Support "git worktree"
2016-08-11 08:09:05 +09:00
Yasuo Ohgaki a38bc7b373 Support "git worktree" 2016-08-11 08:08:26 +09:00
Keyur bb955ec937 Add NEWS 2016-08-09 17:29:36 +00:00
Keyur 2b7715b925 Merge branch 'pull-request/2067' into PHP-7.0 2016-08-09 17:27:52 +00:00
Keyur 2ab9a2d4be Fix ASSERT logic 2016-08-09 14:41:20 +00:00
Keyur 98e4d509f6 Bugfix 72791: fix memory leak in PDO persistent connections 2016-08-09 14:01:25 +00:00
Nikita Popov 842e408c67 Don't copy mime types in CLI server
This is both unnecessary and causes leaks in valgrind.
2016-08-09 15:34:03 +02:00
Christopher Jones 3c5e6b29ce Remove obsolete Id tags 2016-08-09 16:12:58 +10:00
Christopher Jones 797f69ef32 Bump version in OCI8 test 2016-08-09 15:59:59 +10:00
Xinchen Hui e52cb1858d Fixed bug #72788 (Invalid memory access when using persistent PDO connection) 2016-08-09 11:32:16 +08:00
Xinchen Hui ebd21de1e4 Merge branch 'bug72788' of https://github.com/keyurdg/php-src into PHP-7.0
* 'bug72788' of https://github.com/keyurdg/php-src:
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
2016-08-09 11:25:32 +08:00
Keyur a74c7cb528 Remove typo'd commit 2016-08-09 01:36:15 +00:00
Keyur 3f25c4228a Fix bug 72788: Invalid memory access when database_object_handle
is undefined. Also fix memory leak in dbh_free when using persistent
PDO connections.
2016-08-09 00:16:46 +00:00
Andrea Faulds 5358c7cf5e Replace dead branch with ZEND_ASSERT() 2016-08-08 20:56:11 +01:00
Christoph M. Becker 9d03310b23 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-08 18:45:27 +02:00
Christoph M. Becker 243d5fcb1f Add test for bug #69107: finfo no longer detects PHP files 2016-08-08 18:43:33 +02:00
Lauri Kenttä e616bc8694 Fix bug #55451
Make substr_compare ignore the length if it's NULL. This allows to
use the last parameter (case_insensitivity) with the default length.
2016-08-07 18:48:36 +02:00
Nikita Popov 56d7e98ddf Merge branch 'PHP-5.6' into PHP-7.0 2016-08-07 18:38:28 +02:00
Nikita Popov 40d237df1f Fix stream_socket_enable_crypto() test
The whole test doesn't make any sense at all, but this only fixes
the additional warnings you get when linked against openssl w/o
SSL3.
2016-08-07 18:37:38 +02:00
Lior Kaplan 283ee1f6dc Recognize TDS versions 7.3 and 7.4 2016-08-07 15:15:59 +03:00
Christopher Jones dd7cdab8e4 Remove old $Id$ tags 2016-08-07 10:24:56 +10:00
Christopher Jones 944d473eaa Sync with 7.1 branch changes from Nikita & Dimitri to keep OCI8 code identical 2016-08-07 10:17:06 +10:00
Christopher Jones b601dc5b29 Fix bug #72524 (Binding null values triggers ORA-24816 error) 2016-08-07 09:39:44 +10:00
Kalle Sommer Nielsen 3d51b1d544 Fix the fix (Nikita), thanks! 2016-08-06 12:08:13 +02:00
Kalle Sommer Nielsen 5e2b8349b4 Check the return value of dbconvert() in mssql_guid_string(), as it may return -1 in case the conversion failed. In that case false is returned.
Also initialize buffer and buffer2 to NULL, which should fix bug #72039 (Use of uninitialised value on mssql_guid_string).

This only applies to 5.6, as we do not have mssql in 7.0 anymore
2016-08-06 10:17:49 +02:00
Nikita Popov a2a2ea18fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-05 23:09:30 +02:00
Ville Hukkamaki 65056e9d6c Fix #72764
Negotiate data channel encryption after NLST command.
This is to prevent issues with IIS and ProFTPD.
2016-08-05 22:56:54 +02:00
Nikita Popov 807e81937b Fix bug #72767
The page size calculation did not account for the size of the
stack header (or rather it did account for it, but in the wrong
direction...)
2016-08-05 19:55:10 +02:00
Christoph M. Becker 62f12a8b86 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-04 12:09:16 +02:00
Christoph M. Becker a8515a339d Fix broken skip marker in test case 2016-08-04 12:06:07 +02:00
Matteo Beccati 4003595d60 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Clean up FR #72633
2016-08-04 09:30:48 +02:00
Matteo Beccati d3a8e107ac Clean up FR #72633 2016-08-04 09:28:58 +02:00
Christopher Jones 2b7a699acd Fixed invalid handle error with Implicit Result Sets 2016-08-04 17:01:57 +10:00
Christopher Jones 78488a54c8 Fixed invalid handle error with Implicit Result Sets and bump OCI8 version. 2016-08-04 16:55:54 +10:00
Christopher Jones 06be3c659c Merge branch 'PHP-7.0' of https://git.php.net/repository/php-src into PHP-7.0 2016-08-04 16:45:29 +10:00
Stanislav Malyshev b57474f23e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72716 - initialize buffer before read

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-03 23:00:32 -07:00
Stanislav Malyshev 4f861b6071 Fix bug #72716 - initialize buffer before read 2016-08-03 22:59:42 -07:00
Ferenc Kovacs db4211a8fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	configure.in
	main/php_version.h
2016-08-04 01:42:00 +02:00
Ferenc Kovacs 562c17eb4e 5.6.26 will be next 2016-08-04 01:39:37 +02:00
Anatol Belski 138689ffb7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve the check, avoid strlen on NULL
2016-08-03 18:28:48 +02:00
Anatol Belski 9667ee4f72 improve the check, avoid strlen on NULL 2016-08-03 18:26:29 +02:00
Anatol Belski 2bdb34fd40 update NEWS 2016-08-03 17:39:55 +02:00
Anatol Belski 0e82eb48cb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
2016-08-03 17:39:22 +02:00
Anatol Belski f15c155363 update NEWS 2016-08-03 17:38:11 +02:00
Kalle Sommer Nielsen d5796fb298 Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.

The new behavior is to instead of stopping to parse, to continue so we can still fetch data like thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is enabled, a notice will display in case we do not match against a valid MAKERNOTE signature.

This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further.

(cherry picked from commit aabcb5481d)
2016-08-03 17:36:00 +02:00
Anatol Belski e3dabe448d update libs_versions.txt 2016-08-03 15:06:02 +02:00
Anatol Belski 7922e0f0bf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-08-03 15:05:39 +02:00
Anatol Belski 67c2b0a9e8 update libs_versions.txt 2016-08-03 15:03:41 +02:00
Anatol Belski 151c39827a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix ts build
2016-08-03 12:19:29 +02:00
Anatol Belski fad3f936ac fix ts build 2016-08-03 12:16:42 +02:00
Stanislav Malyshev 72dbb7f416 Fix bug #72674 - check both curl_escape and curl_unescape 2016-08-03 00:58:55 -07:00
Nikita Popov 1bcd439cad Fix bug #72724 2016-08-03 00:34:36 +02:00
Christoph M. Becker 3a8c027ec3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-02 18:49:59 +02:00
Christoph M. Becker f5622f5c87 Fix #72709: imagesetstyle() causes OOB read for empty $styles
Calling imagesetstyle() with an empty $styles array caused gdImageSetStyle()
to be called with `noOfPixels==0`, what could have lead to OOB reads.
Actually, this issue will be fixed in libgd, but to avoid issues when older
libgd is in use, we simply disallow passing an empty $styles array to
imagesetstyle(), what wouldn't serve a useful purpose anyway.
2016-08-02 18:43:37 +02:00
Anatol Belski 072af35b5c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  cleanup table after test
  - lastInsertId using Postgres Lastval() function
2016-08-02 14:40:31 +02:00
Anatol Belski e95625f47e update NEWS 2016-08-02 14:36:56 +02:00
Anatol Belski 40b3a031b2 cleanup table after test 2016-08-02 14:35:24 +02:00
Pablo Santiago Sánchez 90c6cbd09b - lastInsertId using Postgres Lastval() function 2016-08-02 14:34:30 +02:00
Anatol Belski 5c51433e2a prepare next 2016-08-02 11:13:20 +02:00
Anatol Belski 9f14920725 fix php_version.h 2016-08-02 11:06:33 +02:00
Anatol Belski 753e6eacd5 update NEWS 2016-07-31 14:58:46 +02:00
Anatol Belski 5f9df47ea8 Revert "upgraded to PCRE 8.39"
This reverts commit 2fba646837.

PCRE-8.39 throws weird valgrind backtraces on some systems, see
http://news.php.net/php.cvs/93494 . Those could be false positives
due to some changes in JIT, still i couldn't 100% ensure this.
Thus, better we continue to ship 8.38 bundled for now, and apply
patches, if needed.
2016-07-31 14:55:17 +02:00
Nikita Popov c4d35c3214 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 18:36:00 +02:00
Nikita Popov c9d3ff0c6e Revert "Fixed bug #71219"
This reverts commit 14d674442e.

I misread the discussion on the bug -- this is not the correct
fix. However the other proposed fix does not work either, so just
reverting for now.
2016-07-30 18:34:34 +02:00
Nikita Popov 9fe0398dad Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 18:24:14 +02:00
Nikita Popov 14d674442e Fixed bug #71219 2016-07-30 18:21:19 +02:00
Nikita Popov dd7bea17bf Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/wddx/wddx.c
2016-07-30 16:29:10 +02:00
Nikita Popov 99613431b4 Add missing TSRMLS_FETCH() 2016-07-30 16:28:42 +02:00
Nikita Popov 029f8e8777 Fix incorrect merge
Forgot to amend the merge fixes...
2016-07-30 16:07:54 +02:00
Nikita Popov 1f67b4c24d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 15:51:23 +02:00
Nikita Popov e87ac688d5 Fixed bug #72142 2016-07-30 15:13:03 +02:00
Christoph M. Becker e5940aa795 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 12:01:29 +02:00
ju1ius 1d32b80903 fixes bad address given to onig_error_code_to_str
Closes bug #72710

(cherry picked from commit 0fb7eb6723bcc6fd98053911543e801edb5ab763)
2016-07-30 11:46:34 +02:00
Nikita Popov 8a442a33c3 Fix ref handling in array_merge/replace_recursive()
As usual, if the reference has rc=1 it really isn't a reference.
2016-07-29 19:07:04 +02:00
Anatol Belski 1666e80cb9 document file cache fallback ini directive 2016-07-29 13:04:51 +02:00
Christoph M. Becker a837b2f6a3 Fix #72320: iconv_substr returns false for empty strings
For consistency with substr() and mb_substr(), iconv_substr() should return
an empty string instead of FALSE, when $offset == iconv_strlen($str).
2016-07-29 11:33:50 +02:00
Christoph M. Becker 293dd3d701 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/calendar/calendar.c
2016-07-29 01:26:15 +02:00
Christoph M. Becker f67ccd4a7b Fix #71894: AddressSanitizer: global-buffer-overflow in zif_cal_from_jd
Julian days < 347998 denote invalid Jewish calendar dates, so
cal_from_jd($jd, CAL_JEWISH) and jdmonthname($jd, CAL_MONTH_JEWISH) should
actually fail. For BC we don't yet let them though, but we fix the OOB read
that happens in this case, and we also adjust cal_from_jd()'s return value
to have empty strings for "abbrevdayname" and "dayname" instead of "Sun"/
"Sunday" and NULL for "dow" instead of 0, which doesn't make any sense.
2016-07-29 01:04:21 +02:00
Christoph M. Becker a952aac6a7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 20:00:37 +02:00
Christoph M. Becker 5c458c9b02 Implement FR #65462: Please add tests for gregorian and jewish overflow fixes 2016-07-28 19:59:14 +02:00
Christoph M. Becker 7c412688f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 19:22:40 +02:00
Christoph M. Becker 7ab39e2fae Fix #67976: cal_days_month() fails for final month of the French calendar
The French calendar ends on 0014-13-05, so trying to calculate the Julian
day of 0015-01-01 fails. We cater to that by returning the hard-coded value.
2016-07-28 19:13:58 +02:00
Nikita Popov 3b48c5a36f Revert "Make call_user_func() on reference args consistent"
This reverts commit fafe01b07b.

See bug #72698, there is code using this behavior. Reverting for
PHP 7.0 *only*. The fix is still in PHP 7.1.
2016-07-28 18:45:44 +02:00
Christoph M. Becker 1693eb9d2a Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 18:24:37 +02:00
Christoph M. Becker ced2a80e6f Bug #69975 had already been fixed as of PHP 5.6.12
Also CVE-2015-8879 had been assigned.
2016-07-28 18:22:19 +02:00
Christoph M. Becker 573568bbce Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 17:30:29 +02:00
Christoph M. Becker c301adbbd1 Fix #72677: SCM_CREDENTIALS related tests should be skipped on AIX
Patch provided by matthieu dot sarter dot external at atos dot net.
2016-07-28 17:19:47 +02:00
Christoph M. Becker 95190db84d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 16:54:36 +02:00
Christoph M. Becker 6e886f07a8 Fix #72676: Test cli_process_title_unix fails on AIX
Patch provided by matthieu dot sarter dot external at atos dot net.
2016-07-28 16:51:45 +02:00
Christoph M. Becker 81c25abd25 Update to SQLite3 3.13.0 2016-07-28 16:39:24 +02:00
Christoph M. Becker 805dc0ea47 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/mbstring/php_mbregex.c
2016-07-28 15:26:29 +02:00
Christoph M. Becker ee6900c3de Fix #72694: mb_ereg_search_setpos does not accept a string's last position
Setting the search position immediately behind the last character should be
allowed, so we fix this off-by-one error.
2016-07-28 15:21:48 +02:00
Christoph M. Becker a621023168 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 14:03:40 +02:00
Christoph M. Becker 56cdaecb28 Fix #72693: mb_ereg_search increments search position when a match zero-width
That's caused by an off-by-one error, which we fix.
2016-07-28 13:57:38 +02:00
Christoph M. Becker 18a37eeeec Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/mbstring/php_mbregex.c
2016-07-28 13:12:40 +02:00
Christoph M. Becker d276e6a838 Fix #72691: mb_ereg_search raises a warning if a match zero-width
That warning doesn't make sense (PCRE doesn't throw such a warning either),
so we remove it.
2016-07-28 13:07:05 +02:00
Christoph M. Becker c7a4e37d97 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 12:29:00 +02:00
Christoph M. Becker 0ae8c337a3 Bug #6836 has already been fixed in PHP 5.6.24 and 7.0.9 2016-07-28 12:26:41 +02:00
Pierrick Charron bf37b97d9c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/curl/interface.c
2016-07-27 23:36:22 -04:00
Pierrick Charron 30a5ed3a79 Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). 2016-07-27 23:30:20 -04:00
Pierrick Charron 1b681880c1 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-27 18:17:43 -04:00
Pierrick Charron ed16f2fed5 Update NEWS 2016-07-27 17:52:05 -04:00
Anatol Belski 266c62070f cleanup the table after the test run 2016-07-27 23:50:10 +02:00
Anatol Belski e0294b39e3 update NEWS 2016-07-27 23:30:23 +02:00
root 12628e9a46 Implemented FR #72633 Postgres PDO lastInsertId() should work without specifying a sequence 2016-07-27 23:00:12 +02:00
Anatol Belski c52322707e Fixed bug #72683 getmxrr broken 2016-07-27 20:48:45 +02:00
Anatol Belski 6e8b2d21d1 update NEWS 2016-07-27 20:41:27 +02:00
Christoph M. Becker 40afd77826 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/pcre/php_pcre.c
2016-07-27 19:00:38 +02:00
Christoph M. Becker 315c0536c2 Fix #72688: preg_match missing group names in matches
We have to multiply with 0x100 to properly scale the high byte.
2016-07-27 18:50:52 +02:00
Bob Weinand 5513f00a97 Fixed a potential segfault in zend_objects_store_free_object_storage()
Under the special circumstance where a garbage collected objects bucket slot was not reused until the end of the script, we get access into freed memory...
No test added as it usually is valgrind-only, and only sometimes when the memory happens to have changed (i.e. (GC_FLAGS(obj) & IS_OBJ_FREE_CALLED) == 0), it actually *may* segfault
2016-07-27 18:08:43 +02:00
Christoph M. Becker 23c359c276 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/sqlite3/sqlite3.c
2016-07-27 16:48:29 +02:00
Christoph M. Becker cc125f277b Implement #72653: SQLite should allow opening with empty filename
From the [sqlite3_open](https://www.sqlite.org/c3ref/open.html) docs:

| If the filename is an empty string, then a private, temporary on-disk
| database will be created. This private database will be automatically
| deleted as soon as the database connection is closed.

We make that facility available to userland.

While we're at it, we also do some minor optimizations, remove the
unnecessary check for NUL characters in filename, which is already catered
to by ZPP(p), and add a missing `return` in case db_obj isn't initialized.
2016-07-27 16:41:03 +02:00
Nikita Popov 0d2c4f822c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:58:06 +02:00
Ville Hukkamäki cce457c68c Fix bug #72667
Open data stream after receiving PASV reply, before sending the
main request.

Included test cases for opendir() with ftp:// and ftps:// wrappers.
Test cases re-use ext/ftp/tests/server.inc

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:55:47 +02:00
Pierrick Charron 6714f73545 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	main/streams/streams.c
2016-07-27 00:38:54 -04:00
Pierrick Charron 074b86d845 Fixed bug #72686 (zlib: url support is broken).
zlib: support is broken since a really long time.
It never worked on versions >= PHP5.6 so we can just remove
this dead code.

Bug was introduced 2006-05-14 (Before 5.2.0)
2016-07-27 00:33:13 -04:00
Pierrick Charron 2597f5d665 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_iterators.c
2016-07-26 20:36:34 -04:00
Pierrick Charron 4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Pierrick Charron 31ed322b06 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-26 19:20:12 -04:00
Pierrick Charron 24d8f6ed7c Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
2016-07-26 18:50:15 -04:00
Anatol Belski 2fba646837 upgraded to PCRE 8.39
(cherry picked from commit 9d4fe9672a)
2016-07-26 15:07:04 +02:00
Nikita Popov b1d36cb820 Fix GMP unserialization with self-reference 2016-07-25 23:04:00 +02:00
Christoph M. Becker ccf39dd552 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/sqlite3/sqlite3.c
#	ext/sqlite3/tests/bug72668.phpt
2016-07-25 17:07:41 +02:00
Christoph M. Becker 64e3e932fc Further fixes wrt. bug #72668
Not only SQLite3::querySingle(), but also SQLite3::query() and
SQLite3Stmt::execute() were affected.
2016-07-25 17:03:10 +02:00
Xinchen Hui f5e56cf970 Fixed bug #72668 (Spurious warning when exception is thrown in user defined function) 2016-07-25 20:28:39 +08:00
Anatol Belski 9a4c9348b1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Make phpize use PHP_PREFIX as the default location (windows)
  Enable 'nmake test' on building extensions
2016-07-25 10:17:41 +02:00
Anatol Belski 0c34d515f1 update NEWS 2016-07-25 10:14:18 +02:00
y-uti 3f842655db Make phpize use PHP_PREFIX as the default location (windows)
The default path to where an extension is installed should be
PHP_PREFIX/ext on windows.
2016-07-25 10:01:34 +02:00
y-uti 72ac8cf5ad Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test'
target rule. This commit fixes that and enables 'nmake test' on
Windows.
2016-07-25 09:55:07 +02:00
Anatol Belski 27dd8048b7 update NEWS 2016-07-25 09:51:13 +02:00
y-uti 0f9bf85ad9 Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test'
target rule. This commit fixes that and enables 'nmake test' on
Windows.
2016-07-25 09:46:06 +02:00
y-uti 6ed7136371 Make phpize use PHP_PREFIX as the default location (windows)
The default path to where an extension is installed should be
PHP_PREFIX/ext on windows.
2016-07-25 09:46:00 +02:00
Christoph M. Becker 138fea83fe Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 02:02:54 +02:00
Christoph M. Becker 305bddb0ed Fix broken test case
d28f1da introduced a test regression, due to potentially additional output
regarding FreeType support. We fix that by making the test more resilient.
2016-07-25 02:00:37 +02:00
Christoph M. Becker 4db4997ac5 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 00:16:21 +02:00
Christoph M. Becker d28f1dae9d Fix broken test case
The test claims that it would be "checking all the values in returned array",
but due to the use of %a it actually skipped elements. We fix that by using
%s instead.
2016-07-25 00:13:44 +02:00
Xinchen Hui ad96a052d9 Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd) 2016-07-24 23:58:22 +08:00
Anatol Belski da3995852e regenerate date parser with re2c 0.15.3 2016-07-24 14:53:53 +02:00
Anatol Belski 8eb94b6e32 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  regenerate date parser with re2c 0.15.3
2016-07-24 14:51:59 +02:00
Anatol Belski 9cd23ff84f regenerate date parser with re2c 0.15.3 2016-07-24 14:50:10 +02:00
Nikita Popov aecc435482 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-24 00:18:47 +02:00
Nikita Popov 04b42b1e05 More tolerance in another IntlCalendar test
Again, off-by-1000 is expected if we're late in the second. Add an
extra 1000 to account for actual delta in call times.
2016-07-24 00:15:14 +02:00
Nikita Popov 2194690625 Ensure session GC is not run during variation6.phpt
The implemented gc() handler simply deletes all sessions, including
the current one. This may cause a subsequent unlink() warning.
Avoid this by preventing GC from running.
2016-07-24 00:07:54 +02:00
Anatol Belski 958fa34c16 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test
2016-07-23 21:03:45 +02:00
Anatol Belski 80fee637f4 fix test 2016-07-23 20:55:39 +02:00
Christoph M. Becker 2c0a18480d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 19:36:53 +02:00
Christoph M. Becker 88838dd282 Fix #68712: suspicious if-else statements 2016-07-23 19:29:43 +02:00
Christoph M. Becker 03ccd42b18 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 18:12:14 +02:00
Christoph M. Becker 9fbd0c1ff1 Fix copy&paste errors in gd_interpolation.c
According to <https://github.com/libgd/libgd/commit/f101380>.
2016-07-23 18:09:18 +02:00
Christoph M. Becker 5056d59f96 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 16:55:16 +02:00
Christoph M. Becker 2c16b9cf62 Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
This issue has already been fixed in libgd[1], so we fix PHP's bundled
libgd accordingly.

[1] <https://github.com/libgd/libgd/commit/aa1d71c>
2016-07-23 16:48:07 +02:00
Bob Weinand 6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Nikita Popov f12fd5c2d3 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-23 13:29:57 +02:00
vhuk 65abdb556d Fix for bug #54431 2016-07-23 13:28:42 +02:00
Nikita Popov 7d77289717 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-22 17:22:13 +02:00
Nikita Popov 4fc1bfa93b Make IntlCalendar::getNow() test more tolerant
Due to the *1000 factor the two values may be off-by-1000 even
without any actual delay, so increase the check to 2000.
2016-07-22 17:20:56 +02:00
Xinchen Hui 6929121423 Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements) 2016-07-22 23:15:15 +08:00
Christoph M. Becker 9a2207c90a Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-22 15:27:55 +02:00
Christoph M. Becker 6b116932b2 Fix #72646: SplFileObject::getCsvControl does not return the escape character
This has obviously been missed when adding the $escape parameter to
SplFileObject::setCsvControl() in PHP 5.3, so we catch up on this.
2016-07-22 15:24:50 +02:00
Remi Collet 9622f973a5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  FPM: add test for CVE-2016-5385
2016-07-22 09:36:36 +02:00
Remi Collet fb4a6dc0f1 FPM: add test for CVE-2016-5385 2016-07-22 09:35:09 +02:00
Christoph M. Becker 4472f9e822 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 18:39:27 +02:00
Christoph M. Becker f2c2a4be9e Fix #72330: CSV fields incorrectly split if escape char followed by UTF chars
We must not forget to properly reset the state for multibyte characters
following an escape character.
2016-07-21 18:37:24 +02:00
Christoph M. Becker 7e2c3a77c0 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 16:50:37 +02:00
Pieter Hordijk f813f43855 Removed incorrect (leftover?) sentence in ini
about mbstring or iconv output handler
2016-07-21 16:49:14 +02:00
Remi Collet a2a122804e bump zip extension version 2016-07-21 08:44:26 +02:00
Xinchen Hui 4a643e5e13 Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property) 2016-07-21 14:25:15 +08:00
Anatol Belski 7e1843fc04 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-07-21 01:55:42 +02:00
Anatol Belski e7168519dd update libs_version.txt 2016-07-21 01:54:53 +02:00
Anatol Belski 8b191921c3 update libs_versions.txt 2016-07-21 01:52:03 +02:00
Ferenc Kovacs 027a82e4e6 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 00:37:41 +02:00
Ferenc Kovacs c9f21e8319 update NEWs 2016-07-21 00:36:07 +02:00
Anatol Belski 462a9aa190 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  regenerate date parser with re2c 0.13.5 to fix OSX issues
2016-07-20 18:00:53 +02:00
Anatol Belski b57a38f584 regenerate date parser with re2c 0.13.5 to fix OSX issues 2016-07-20 17:57:39 +02:00
Anatol Belski 90c26fb6b1 regenerate date parser with re2c 0.13.5 2016-07-20 13:32:53 +02:00
Xinchen Hui e4af29b0b7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed arginfo
2016-07-20 18:07:18 +08:00
Xinchen Hui 9ebc96116b Fixed arginfo 2016-07-20 18:07:02 +08:00
Derick Rethans 1dafa806a9 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-20 10:21:03 +01:00
Derick Rethans 18ba78e988 Regenerate with the -b flag, as we used to do.
Apparently, Apple's LLVM can't handle it otherwise o_O.
2016-07-20 10:19:53 +01:00
Xinchen Hui cbbe17fb53 Fixed typo 2016-07-20 17:01:42 +08:00
Xinchen Hui 97c0b133c5 Fixed bug #72629 (Caught exception assignment to variables ignores references). 2016-07-20 16:59:14 +08:00
Xinchen Hui 3c3b8c8365 Fixed bug #72622 (array_walk + array_replace_recursive create references from nothing) 2016-07-20 16:12:37 +08:00
Stanislav Malyshev df5ee7bc25 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Improve fix for #72520
  #72482, revert for 5.6 for now

Conflicts:
	ext/zip/zip_stream.c
2016-07-19 22:38:35 -07:00
Stanislav Malyshev 17a53f9e60 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Improve fix for #72520
2016-07-19 22:37:44 -07:00
Stanislav Malyshev 8ebdb1f5fd Improve fix for #72520 2016-07-19 22:37:03 -07:00
Anatol Belski ec97e78a8d update UPGRADING 2016-07-19 20:34:22 +02:00
Anatol Belski 1eb13c5204 sync NEWS 2016-07-19 20:27:30 +02:00
Pierre Joye e8b768dd92 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2016-07-20 00:18:56 +07:00
Pierre Joye 9cc0a5a9a9 #72482, revert for 5.6 for now 2016-07-20 00:18:25 +07:00
Christoph M. Becker d42ce593ff Merge branch 'PHP-5.6' into PHP-7.0 2016-07-19 18:00:49 +02:00
Christoph M. Becker 206d45bc17 Update NEWS 2016-07-19 17:58:29 +02:00
Christoph M. Becker 8466155ff5 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-19 17:41:16 +02:00
Christoph M. Becker 828f911efd Fix #43828: broken transparency of imagearc for truecolor in blendingmode
No pixel of a filled arc must ever be drawn multiple times. Otherwise we get
artifacts regarding transparency. That happens with the current
implementation of gdImageFilledArc() unless gdChord or gdNoFill are set.
When gdPie is set, however, the filled arc is drawn in wedges, which are
polygons of three points, and so some overlap is natural.

To resolve the issue, we stick with the current algorithm of calculating the
wedges, but instead of drawing each polygon separately, we put the relevant
points in a large array, and draw a single polygon. That also is supposed to
improve the performance considerably.

Note that this modification will change the results when gdImageSetStyle()
or gdImageSetBrush() are used, but we believe that this modification is also
an improvement in this regard, even though it still might not make much
sense to use these functions with gdImageFilledArc().

The respective fix for libgd is
<https://github.com/libgd/libgd/commit/e7e20d6>.
2016-07-19 17:38:26 +02:00
Stanislav Malyshev 374ae8e9da Fix for bug #72513
This is applicable to 7 as well, but was somehow missing from the merge.
2016-07-19 17:18:24 +02:00
Anatol Belski 8e0594a944 fix test out
this test also affected by #70313 which is not in the release branch
2016-07-19 15:05:14 +02:00
Anatol Belski 6571a90f7f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test portability and expectation
2016-07-19 14:50:45 +02:00
Anatol Belski bd1919504b fix test portability and expectation
The test images for #72603 and #72618 are broken, that seems to be
the cause of different test output. Seems also to be platform dependent,
so it's not reliable to depend on the exact error output.
2016-07-19 14:49:24 +02:00
Pierre Joye 77a71cba20 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  #72482, Ilegal write/read access caused by gdImageAALine overflow
2016-07-19 19:34:51 +07:00
Pierre Joye b25009fc2c #72482, Ilegal write/read access caused by gdImageAALine overflow 2016-07-19 19:34:07 +07:00
Pierre Joye 2767d1953f merge conflict 2016-07-19 18:55:09 +07:00
Pierre Joye 1d69028d2f fix #72494, improve input color check and prevent issues when old gd are used, done before gd call 2016-07-19 18:23:51 +07:00
Pierre Joye 834f7a39be Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2016-07-19 16:34:55 +07:00
Pierre Joye dbbfb23c62 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-07-19 16:34:15 +07:00
Pierre Joye 1e9273c48b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, free contribRow as well
2016-07-19 16:33:38 +07:00
Pierre Joye 48e76abadd improve fix #72558, free contribRow as well 2016-07-19 16:33:17 +07:00
Stanislav Malyshev f1ea7d195a Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:php-src:
2016-07-19 01:57:40 -07:00
Stanislav Malyshev caa96c4416 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, while (u>=0) with unsigned int will always be true
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 01:56:57 -07:00
Stanislav Malyshev 894df05fe8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 01:56:49 -07:00
Pierre Joye 7521149193 improve fix #72558, while (u>=0) with unsigned int will always be true 2016-07-19 01:56:35 -07:00
Pierre Joye bc8c722cb4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve fix #72558, while (u>=0) with unsigned int will always be true
2016-07-19 15:53:25 +07:00
Pierre Joye df09515089 improve fix #72558, while (u>=0) with unsigned int will always be true 2016-07-19 15:51:43 +07:00
Stanislav Malyshev 9698082306 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix memory leak
2016-07-19 01:47:48 -07:00
Stanislav Malyshev f69362d212 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix memory leak
2016-07-19 01:47:40 -07:00
Stanislav Malyshev 47d6ea6332 Fix memory leak 2016-07-19 01:47:27 -07:00
Stanislav Malyshev b00f8f2a5b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  5.6.24RC1
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	Zend/zend_virtual_cwd.c
	ext/bz2/bz2.c
	ext/exif/exif.c
	ext/session/session.c
	ext/snmp/snmp.c
	ext/standard/basic_functions.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 01:39:28 -07:00
Stanislav Malyshev e9a58bee24 Merge branch 'PHP-7.0.9' into PHP-7.0
* PHP-7.0.9:
  Partial fix for bug #72613 - do not allow reading past error read
  update NEWS
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
  Fix bug #72551 and bug #72552 - check before converting size_t->int
  Fix bug #72541 - size_t overflow lead to heap corruption
  fix possible optimization bug
  set versions

Conflicts:
	configure.in
	ext/pdo_pgsql/tests/bug72570.phpt
	main/php_version.h
2016-07-19 01:08:18 -07:00
Stanislav Malyshev 4d0565b5ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	ext/bz2/bz2.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 00:53:08 -07:00
Stanislav Malyshev 1a88692692 Merge branch 'PHP-5.6.24' into PHP-5.6
* PHP-5.6.24:
  Fix for bug #72513
  5.6.24RC1

Conflicts:
	configure.in
	main/php_version.h
2016-07-19 00:51:27 -07:00
Stanislav Malyshev f0a17b3a86 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  fix #72519, possible OOB using imagegif
2016-07-19 00:44:08 -07:00
Anatol Belski 905310d144 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
2016-07-19 09:42:28 +02:00
Anatol Belski 9bb5f64871 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
2016-07-19 09:40:26 +02:00
Pierre Joye 8dc5ffa479 fix #72519, possible OOB using imagegif 2016-07-19 00:37:53 -07:00
Pierre Joye 928aecc002 fix #72512, invalid read or write for palette image when invalid transparent index is used
Conflicts:
	ext/gd/libgd/gd.c
2016-07-19 00:37:38 -07:00
Pierre Joye 7b1572b177 fix #72519, possible OOB using imagegif
fix #72519, possible OOB using imagegif
2016-07-19 09:33:34 +02:00
Pierre Joye 05e8a0febe Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:20 +07:00
Pierre Joye b61bd1243a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:01 +07:00
Stanislav Malyshev 33c1a55b40 Apparently some envs miss SIZE_MAX 2016-07-19 00:13:25 -07:00
Pierre Joye 2fbce5f51f fix #72519, possible OOB using imagegif 2016-07-19 14:11:44 +07:00
Pierre Joye 740661bd7a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:40:34 +07:00
Pierre Joye 511f07b747 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:39:46 +07:00
Pierre Joye 0fbcff1b35 fix #72512, invalid read or write for palette image when invalid transparent index is used 2016-07-19 13:37:23 +07:00
Stanislav Malyshev 08ac37bd2a Merge branch 'PHP-5.5.38' into PHP-5.5
* PHP-5.5.38:
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434
2016-07-18 23:32:38 -07:00
Stanislav Malyshev 1364742be9 Fix tests 2016-07-18 23:30:51 -07:00
Stanislav Malyshev 41131cd41d Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment 2016-07-18 23:21:51 -07:00
Stanislav Malyshev 5faa15c4ce Partial fix for bug #72613 - do not allow reading past error read 2016-07-18 23:01:36 -07:00
Stanislav Malyshev f3feddb5b4 Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t 2016-07-18 22:24:52 -07:00
Stanislav Malyshev e6c48213c2 Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c 2016-07-18 21:44:39 -07:00
Christoph M. Becker d565d4bc1c Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/gd.c
2016-07-19 00:48:10 +02:00
Christoph M. Becker 3c3980caa1 Merge branch 'pull-request/1991' into PHP-5.6 2016-07-19 00:42:49 +02:00
Christoph M. Becker 6cb75fb1e8 Fix #70315: 500 Server Error but page is fully rendered
That happens because the external libgd uses other error codes than PHP
(and the bundled libgd), but the libgd error codes are simply forwarded
to php_verror(). We fix that by properly mapping libgd errors to PHP errors.
2016-07-19 00:18:07 +02:00
Stanislav Malyshev d1a491acf3 Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() 2016-07-18 00:17:48 -07:00
Stanislav Malyshev e4d55878dd Merge branch 'PHP-7.0.9' of git.php.net:php-src into PHP-7.0.9
* 'PHP-7.0.9' of git.php.net:php-src:
  update NEWS
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
2016-07-17 16:43:27 -07:00
Stanislav Malyshev eebcbd5de3 Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE 2016-07-17 16:34:21 -07:00
Nikita Popov 31cbe23a9a Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_gc.c
2016-07-16 23:02:34 +02:00
Nikita Popov 171c759d79 Revert "Fixed bug #72286 (Segmentation fault During Garbage Collection)"
This reverts commit 1c84b55ade.
2016-07-16 23:02:23 +02:00
Christoph M. Becker 190fbb94e7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-15 20:02:44 +02:00
Christoph M. Becker 3666cfab97 Fix #72604: imagearc() ignores thickness for full arcs
We remove the special casing for full arcs, what conforms to external libgd.
2016-07-15 19:45:52 +02:00
Christoph M. Becker b01b093ca9 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-15 01:14:41 +02:00
Christoph M. Becker a4aa4f9772 Fix bug #66502: DOM document dangling reference
When we decrement the refcount of a node's document, we state that we
won't need it anymore. Therefore we can *always* set the pointer to the
document to NULL, what avoids invalid memory accesses for some edge cases
as demonstrated with the PHPT.

Original patch provided by Sean Heelan.
2016-07-15 01:08:08 +02:00
Nikita Popov 0b0e7520a9 Fix test output
The error is now detected earlier, so the message ends up being
different.
2016-07-14 23:22:09 +02:00
Nikita Popov a50a5c1bf1 Fix is_callable() on abstract method via object 2016-07-14 21:41:41 +02:00
Dmitry Stogov 99a5170781 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72286 (Segmentation fault During Garbage Collection)
2016-07-14 22:38:47 +03:00
Dmitry Stogov 1c84b55ade Fixed bug #72286 (Segmentation fault During Garbage Collection) 2016-07-14 22:37:25 +03:00
Anatol Belski d67e92af8a Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-07-14 21:21:01 +02:00
Anatol Belski d4b455ae3f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Extend libxml exports
  Updated NEWS
  Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
  Updated NEWS
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
  Update PHP 5.5 NEWS entries with CVE info
2016-07-14 21:16:07 +02:00
Anatol Belski d0c98366d0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Extend libxml exports
  Updated NEWS
  Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
  Updated NEWS
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
  Update PHP 5.5 NEWS entries with CVE info
2016-07-14 21:13:49 +02:00
Anatol Belski fe1d6feb3d Extend libxml exports
These are needed to support libxslt 1.1.29 on Windows. This libxslt version
fixes CVE-2015-7995 and for this reason needs to be used.
2016-07-14 21:08:54 +02:00
Nikita Popov a26748d7be Fix bad merge
In master the operand is fetched earlier, I didn't account for
that.
2016-07-14 20:44:36 +02:00
Nikita Popov 411eee7b5a Fix leak when creating timezone with null bytes 2016-07-14 18:39:16 +02:00
Nikita Popov 00047fcf84 Fix leak when dynamically calling abstract method 2016-07-14 18:39:08 +02:00
Nikita Popov 587668be56 Fix leak of class name when printing exception backtrace 2016-07-14 18:38:58 +02:00
Nikita Popov c3804a2cf9 Fix leaks in yield from error conditions
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 18:38:45 +02:00
Nikita Popov d1f82bfeb2 Fix leak for by-ref assign to overloaded object
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 18:38:04 +02:00
Nikita Popov 82ce2a4e4d Add missing call opcodes in cleanup_unfinished_calls()
Otherwise we may leak if an exception is thrown from them.
2016-07-14 18:37:28 +02:00
Nikita Popov 5063b5aea1 Fix leak if throw_exception_object() fails 2016-07-14 18:37:21 +02:00
Christoph M. Becker 5829458215 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-14 17:25:13 +02:00
Christoph M. Becker 8bb3bd04a9 Fix bug #72596: imagetypes function won't advertise WEBP support
We add the constant IMG_WEBP and make sure that WebP support is properly
reported by imagetypes().
2016-07-14 17:17:59 +02:00
Anatol Belski 9d3b729803 update NEWS 2016-07-14 13:21:38 +02:00
Anatol Belski 131117f7a5 update NEWS 2016-07-14 13:20:13 +02:00
Matteo Beccati 0f182c2495 Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
Special commit for 7.0.9
2016-07-14 12:05:40 +02:00
Dmitry Stogov f80bb059b3 Fixed memory leak 2016-07-14 13:05:27 +03:00
Xinchen Hui 8c5b27e061 Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals) 2016-07-14 13:36:43 +08:00
Nikita Popov 61a2566dc9 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-13 21:57:14 +02:00
Nikita Popov 3cc4265527 Add NEWS entry 2016-07-13 21:57:01 +02:00
Nikita Popov 57c9983619 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/reflection/php_reflection.c
2016-07-13 21:48:05 +02:00
nikita2206 eb190b4e91 fix: bug72222 for PHP-5.6 reflection export of array consts 2016-07-13 21:39:55 +02:00
Stanislav Malyshev 3798eb6fd5 Fix bug #72562 - destroy var_hash properly 2016-07-12 23:27:45 -07:00
Stanislav Malyshev 3810e7b362 Fix bug #72551 and bug #72552 - check before converting size_t->int 2016-07-12 23:13:52 -07:00
Stanislav Malyshev 2ca8d85dd4 Fix bug #72541 - size_t overflow lead to heap corruption 2016-07-12 22:59:19 -07:00
Stanislav Malyshev aa82e99ed8 Fix bug #72533 (locale_accept_from_http out-of-bounds access) 2016-07-12 22:37:36 -07:00
Stanislav Malyshev 81406c0c1d Fix fir bug #72520 2016-07-12 22:05:00 -07:00
Stanislav Malyshev 0218acb7e7 Fix for bug #72513 2016-07-12 22:03:09 -07:00
Stanislav Malyshev a099545bec Fix for bug #72513 2016-07-12 21:52:27 -07:00
Stanislav Malyshev aca4f65c7e CS fix and comments with bug ID 2016-07-12 21:35:02 -07:00
Keyur 7ed028b108 Merge branch 'PHP-7.0' of https://git.php.net/push/php-src into PHP-7.0 2016-07-13 03:15:03 +00:00
Keyur 28e2f749e4 Add to NEWS 2016-07-13 03:03:26 +00:00
Keyur b512f4a956 Fixes #72590: Opcache restart with kill_all_lockers does not work
ACCEL_LOG_ERROR is special and causes a zend_bailout() and the code
never gets to call kill() in the next line after the logging. Change
the log level to WARNING.
2016-07-13 03:01:26 +00:00
Xinchen Hui 8129b83992 Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML element) 2016-07-13 10:49:58 +08:00
Anatol Belski be77ce37fd missed the dot 2016-07-12 17:04:41 +02:00
Anatol Belski 3e6e590784 update NEWS 2016-07-12 17:01:51 +02:00
Julien Pauli 6173488110 Updated NEWS 2016-07-12 15:51:23 +02:00
Julien Pauli 152d53c844 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
  Revert "Fix test for #52384"

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 15:50:58 +02:00
Julien Pauli 1896ca4e88 Updated NEWS 2016-07-12 15:47:05 +02:00
Julien Pauli 822498128b Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
This reverts commit 15336b44d9.
2016-07-12 15:46:07 +02:00
Julien Pauli 5cce0d7c7c Revert "Fix test for #52384"
This reverts commit 642e44b98f.
2016-07-12 15:45:49 +02:00
Julien Pauli c96a9ca6f5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix test for #52384
2016-07-12 15:27:57 +02:00
Julien Pauli 642e44b98f Fix test for #52384 2016-07-12 15:27:37 +02:00
Anatol Belski 3e8dbb3e5d Fixed bug #72569 DOTNET/COM array parameters broke in PHP7 2016-07-12 14:58:50 +02:00
Christoph M. Becker 5fbcc2b90f Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/intl/idn/idn.c
2016-07-12 14:52:23 +02:00
Christoph M. Becker 76e249d31c Partially fix #72506: idn_to_ascii for UTS #46 incorrect for long domain names
We don't actually fix this issue wrt. the empty $info array, because it is
not clear what this array should contain and we're concerned about the
potential BC break, but at least we fix the inconsistent handling of
resulting domains with 255 bytes (which raise an error), and longer domains
(which just return FALSE), what has to be considered a very minor BC break
if at all.
2016-07-12 14:47:14 +02:00
Anatol Belski aabca89f95 update NEWS 2016-07-12 13:01:54 +02:00
y-uti acc58f1845 Make phpize set a proper build type (windows) 2016-07-12 12:59:11 +02:00
Julien Pauli ca08ed417e Updated NEWS 2016-07-12 11:17:58 +02:00
Julien Pauli ec28576260 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT.

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 11:17:36 +02:00
Julien Pauli 17d4f5c2f8 Updated NEWS 2016-07-12 10:49:04 +02:00
Bishop Bettini 15336b44d9 Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT. 2016-07-12 10:47:07 +02:00
Julien Pauli 932191a6ed Updated NEWS 2016-07-12 10:38:40 +02:00
Julien Pauli 3c356aa7cb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fix #72575: using --allow-to-run-as-root should ignore missing user directive
2016-07-12 10:38:22 +02:00
Julien Pauli 403f23b460 Updated NEWS 2016-07-12 10:37:59 +02:00
gooh fb49f137ec Fix #72575: using --allow-to-run-as-root should ignore missing user
directive

Trying to start PHP-FPM with the --allow-to-run-as-root flag will not
work when the user directive is not given in the FPM worker pool
configuration. Parsing the config will fail. Consequently, FPM cannot
start.

The check is in place to prevent FPM from getting started with root
privileges by accident. Prior to #61295 the check would also prevent
any non-root user to start PHP-FPM without a user directive present.

This patch adds an additional check to the config parser, checking for
the --allow-to-run-as-root flag to be present. If so, parsing will no
longer abort for root users even if the user directive is missing.

I will also update the PHP docs since they still state the user
directive is a mandatory setting which it is not since #61295.
2016-07-12 10:36:17 +02:00
Julien Pauli a8566ee800 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fix 72122 - don't use EH_THROW for calls to getIterator
2016-07-12 10:20:01 +02:00
Julien Pauli d2d17e14ee Updated NEWS 2016-07-12 10:19:45 +02:00
Loz Calver f5ccd71d0c Fix 72122 - don't use EH_THROW for calls to getIterator 2016-07-12 10:10:35 +02:00
Xinchen Hui f71fcf8bdd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport to 5.6 (we should not unset the default value)

Conflicts:
	Zend/zend_exceptions.c
	ext/standard/tests/serialize/bug69152.phpt
2016-07-12 12:18:09 +08:00
Xinchen Hui 7903276f4c backport to 5.6 (we should not unset the default value) 2016-07-12 12:14:45 +08:00
Xinchen Hui 42902919bc Fixed bug #72581 (previous property undefined in Exception after deserialization) 2016-07-12 11:51:20 +08:00
Christoph M. Becker 90e11e0c13 Update NEWS 2016-07-11 16:09:12 +02:00
Christoph M. Becker 23d4c9e6c7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-11 16:08:10 +02:00
Christoph M. Becker 966311e627 Bug #66836 has been fixed 2016-07-11 16:06:35 +02:00
Julien Pauli fc2c301fe2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Remove needless zeroing of anonymously mmap'd memory
  Remove needless zeroing of anonymously mmap'd memory
2016-07-11 14:58:55 +02:00
Julien Pauli 2552cf248d Remove needless zeroing of anonymously mmap'd memory 2016-07-11 14:58:12 +02:00
Michael McConville 9dd5d96332 Remove needless zeroing of anonymously mmap'd memory
All existing systems zero anonymously mmapped memory, and if I
understand correctly POSIX will be specifying this soon. Many projects
already rely on it, so no reasonable system would return memory of
unspecified value.
2016-07-11 14:56:17 +02:00
Derick Rethans 7759d6b0db Merge branch 'PHP-5.6' into PHP-7.0 2016-07-11 11:32:10 +01:00
Derick Rethans 6a5e1783b7 Generate new .c file from .re file, as that was missing on my previous commit 2016-07-11 11:31:43 +01:00
Xinchen Hui a19655cfe3 Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash) 2016-07-11 11:51:19 +08:00
Stanislav Malyshev 98b9dfaec9 Fix for HTTP_PROXY issue.
The following changes are made:
- _SERVER/_ENV only has HTTP_PROXY if the local environment has it,
  and only one from the environment.
- getenv('HTTP_PROXY') only returns one from the local environment
- getenv has optional second parameter, telling it to only consider
  local environment
2016-07-10 16:21:11 -07:00
Matteo Beccati 4d677ae0e2 Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders 2016-07-10 14:36:07 +02:00
Matteo Beccati 11d74b5b79 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #70313 PDO statement fails to throw exception
2016-07-10 14:34:59 +02:00
Matteo Beccati 219ebcb689 Fixed bug #70313 PDO statement fails to throw exception 2016-07-10 14:33:56 +02:00
Julien Pauli 6725863993 Updated NEWS 2016-07-08 16:32:32 +02:00
Julien Pauli 13a5c54068 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  update filter_var filters for ipv4 addresses to reflect rfc6890
2016-07-08 16:31:53 +02:00
Julien Pauli 51d19891a4 Updated NEWS 2016-07-08 16:31:42 +02:00
Jos Elstgeest 6fc7817558 update filter_var filters for ipv4 addresses to reflect rfc6890 2016-07-08 16:30:06 +02:00
Adam Baratz 8db64e919c Correct for connection with PDO::ATTR_STRINGIFY_FETCHES set to false 2016-07-08 15:54:52 +02:00
Julien Pauli bdf1b22da5 Updated NEWS 2016-07-08 15:36:38 +02:00
Christoph M. Becker 82637e8187 Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
The SQL Server Native Client 11.0 and maybe other ODBC drivers report
NVARCHAR(MAX) columns as SQL_WVARCHAR with size 0. This causes too small a
buffer to be emalloc'd, likely causing a segfault in the following. As we don't
know the real size of the column data, we treat such colums as
SQL_WLONGVARCHAR.

The related bug #67437 suggests that some drivers report a size of ~4GB. It is
not certain that this is really the case (there might be some integer overflow
involved, and anyway, there has been no feedback), so we do not cater for this
now. However, it would not be hard to treat all sizes above a certain threshold
in a similar way, i.e. as SQL_WLONGVARCHAR.

(cherry picked from commit 16db4d1462)
(cherry picked from commit 344ff5dd4c)
2016-07-08 15:33:46 +02:00
Julien Pauli a8df121e18 Updated NEWS 2016-07-08 15:06:21 +02:00
Julien Pauli 87fe485c35 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Backported bug #71144 (Segmentation fault when using cURL with ZTS)
  fix bug #72024 (microtime() leaks memory)

Conflicts:
	ext/curl/interface.c
2016-07-08 15:05:13 +02:00
Julien Pauli 1071a2655f Updated NEWS 2016-07-08 15:04:13 +02:00
Julien Pauli 78d5783b62 Backported bug #71144 (Segmentation fault when using cURL with ZTS) 2016-07-08 14:58:56 +02:00
Michael Maroszek 0be13d2dc2 fix bug #72024 (microtime() leaks memory) 2016-07-08 14:36:44 +02:00
Julien Pauli 51b584b159 Updated NEWS 2016-07-08 14:35:43 +02:00
Julien Pauli 7377f45b61 Merge branch 'pull-request/1982' into PHP-5.5
* pull-request/1982:
  Update PHP 5.5 NEWS entries with CVE info
2016-07-08 14:24:05 +02:00
Remi Collet 7ae00f08cf NEWS 2016-07-08 10:47:40 +02:00
Remi Collet 99d6e09c3d Fixed Bug #72564 boolean always deserialized as "true" 2016-07-08 10:46:33 +02:00
Remi Collet 76a143c27c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test for bug #72564 (7.x regression)
2016-07-08 10:45:32 +02:00
Remi Collet bfc42211d3 add test for bug #72564 (7.x regression) 2016-07-08 10:45:13 +02:00
Christopher Jones fae6407314 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-07 11:52:39 +10:00
Christopher Jones 8b905e337c Mask DB usernames from expected test output for test portability 2016-07-07 11:52:17 +10:00
Ferenc Kovacs 3580b9f8b6 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-07 01:49:05 +02:00
Ferenc Kovacs 2b7cd813e7 merge NEWS blocks 2016-07-07 01:46:02 +02:00
Ferenc Kovacs 0ca1698cf9 5.6.24RC1 2016-07-07 01:43:25 +02:00
Nikita Popov 06b6cb0ab0 Add NEWS entries 2016-07-07 01:31:04 +02:00
Lauri Kenttä 3104759915 base64_decode: fix bug #72264 ('VV= =' shouldn't fail in strict mode) 2016-07-07 01:27:23 +02:00
Lauri Kenttä 0259459486 base64_decode: remove redundant code
case 1 is already handled in the first lines of the for loop;
it would only be entered in the invalid case where the string
continues past the defined length (ch != 0 but length-- == 0).

case 2 and case 3 are redundant, since k >= j and later the
string is truncated to j characters anyway.
2016-07-07 01:27:23 +02:00
Lauri Kenttä c1ac081bf1 base64_decode: fix bug #72263 (skips char after padding) 2016-07-07 01:27:23 +02:00
Lauri Kenttä b9c9be13cc base64_decode: fix bug #72152 (fail on NUL bytes in strict mode)
This added check is actually for NOT failing in NON-strict mode.
The ch == -2 check later causes the desired failure in strict mode.
2016-07-07 01:27:23 +02:00
Lauri Kenttä ef6f163161 base64_decode: remove redundant check
If length == 0 || *current != '=' is false, the for loop will always
end up in this same point, until the if statement becomes true.
Thus, the if statement is not needed.
2016-07-07 01:27:23 +02:00
Lauri Kenttä c65de8ac13 base64_decode: reorder to fix out of bounds read 2016-07-07 01:27:22 +02:00
Ferenc Kovacs ea640e6117 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	configure.in
	main/php_version.h
2016-07-07 01:16:58 +02:00
Ferenc Kovacs c1280db28a 5.6.25 is next 2016-07-07 00:09:48 +02:00
Derick Rethans a4e140e6ab Updated to version 2016.6 (2016f) 2016-07-06 11:15:45 +01:00
Derick Rethans 7008a36627 Empty merge 2016-07-06 11:15:44 +01:00
Derick Rethans 884db2f7be Updated to version 2016.6 (2016f) 2016-07-06 11:15:42 +01:00
Anatol Belski b63d41e1e5 add tests for bug #72512 2016-07-06 10:40:52 +02:00
Matteo Beccati ff7c981d19 Rewrite test to avoid sending emails
A properly configured email server was generating bounce emails when running
the test.
2016-07-06 07:08:43 +02:00
Christoph M. Becker 869604eefb Update NEWS 2016-07-05 16:49:40 +02:00
Christoph M. Becker c015095042 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-05 16:43:39 +02:00
Valentin VALCIU 4c24f170ea Fix bug #55701: GlobIterator throws LogicException
GlobIterator throws LogicException with message 'The parent constructor was
not called' on its first operation when the glob expression doesn't match
any file. It also throws on the first operation after the iteration
completes, when the glob expression matches some files.

# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-05 16:39:25 +02:00
Adam Baratz f22bc6438d Use size_t instead of int for loop counter 2016-07-05 16:09:27 +02:00
Anatol Belski 8bd8a64db6 fix possible optimization bug 2016-07-05 15:07:24 +02:00
Anatol Belski 4576c41291 fix possible optimization bug 2016-07-05 14:57:16 +02:00
Nikita Popov 8a555d7c66 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2016-07-05 14:32:38 +02:00
Pedro Magalhães 08777e9615 Don't enforce LSP if prototype method is private
Fixes bug #72496.
2016-07-05 14:30:22 +02:00
Anatol Belski adf0920065 fix typo 2016-07-05 12:36:55 +02:00
Stanislav Malyshev e1ba58f068 Fix bug #70480 (php_url_parse_ex() buffer overflow read)
(cherry picked from commit 629e4da7cc)
2016-07-05 10:59:02 +02:00
Anatol Belski a66cae883b set versions 2016-07-05 08:29:51 +02:00
Anatol Belski 2ed986d3c8 prepare next version 2016-07-05 08:09:20 +02:00
Lior Kaplan ac56700125 Update PHP 5.5 NEWS entries with CVE info 2016-07-04 16:31:39 +02:00
Anatol Belski a4a34c2c0b add missing NEWS entry 2016-07-04 11:05:49 +02:00
Pierre Joye 7b2c22696a Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access 2016-07-04 10:35:20 +02:00
Christoph M. Becker 60fc27f912 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-04 03:18:50 +02:00
Christoph M. Becker 717a043a32 Fix typo in comment 2016-07-04 03:17:17 +02:00
Ferenc Kovacs 50433f708e Merge branch 'PHP-5.6' into PHP-7.0 2016-07-03 23:35:00 +02:00
Ferenc Kovacs 9a9ede00bc this was actually fixed in 5.6.23 2016-07-03 23:31:32 +02:00
Xinchen Hui f6aaaf02a9 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  update NEWS
  extend test
  Fixed bug #72534 stream_socket_get_name crashes
2016-07-03 23:57:42 +08:00
Xinchen Hui 612aff3a8a Fixed bug #72538 (readline_redisplay crashes php) 2016-07-03 23:56:27 +08:00
Anatol Belski b90c2fc7b9 update NEWS 2016-07-03 17:15:19 +02:00
Anatol Belski 8b229bfeeb extend test 2016-07-03 17:13:46 +02:00
Anatol Belski ea9da7529c Fixed bug #72534 stream_socket_get_name crashes 2016-07-03 17:09:19 +02:00
Xinchen Hui 6744737577 Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow) 2016-07-03 09:30:33 +08:00
Anatol Belski c9fa39da5e update NEWS 2016-07-01 18:44:20 +02:00
Anatol Belski 3455848dfe Fixed bug #72498 variant_date_from_timestamp null dereference 2016-07-01 18:41:50 +02:00
Nikita Popov 9b8f1d6037 Don't use FUNC_ARG fetches for call_user_func()
This makes no sense -- SEND_USER can't even handle INDIRECTs.
2016-06-28 21:34:20 +02:00
Nikita Popov fafe01b07b Make call_user_func() on reference args consistent
Previously reference arguments were allowed if call_user_func()
was compiled to SEND_USER and not otherwise. Make it consistent
by always forbidding them.
2016-06-28 20:43:38 +02:00
Xinchen Hui 76370f30db Fixed test 2016-06-28 15:39:02 +08:00
Xinchen Hui ce7e180a04 Fixed bug #72508 (strange references after recursive function call and "switch" statement) 2016-06-28 15:36:50 +08:00
Xinchen Hui de7a6b1232 MFH: Fixed fd leak (the origin commit can not be cherry-picked) 2016-06-28 11:36:27 +08:00
Xinchen Hui 86732b4ea0 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix the fix for #72403 on nl2br
  Update NEWS
  Update NEWS
  Fix #70628: Clearing bindings on an SQLite3 statement doesn't work
  5.5.38 now
2016-06-28 11:11:39 +08:00
Xinchen Hui c73a2f7f45 Fixed bug #72505 (readfile() mangles files larger than 2G) 2016-06-28 11:11:25 +08:00
Stanislav Malyshev ec82c6b4e1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix the fix for #72403 on nl2br
  5.5.38 now

Conflicts:
	ext/standard/string.c
2016-06-27 12:32:58 -07:00
Stanislav Malyshev b8487b6a7d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix the fix for #72403 on nl2br
  5.5.38 now

Conflicts:
	configure.in
	main/php_version.h
2016-06-27 12:32:11 -07:00
Stanislav Malyshev 25bd11cf27 Fix the fix for #72403 on nl2br 2016-06-27 12:30:42 -07:00
Christoph M. Becker b5fc4dbf21 Update NEWS 2016-06-27 17:17:34 +02:00
Christoph M. Becker 0f03224d59 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-27 17:09:55 +02:00
Christoph M. Becker 1314db7109 Update NEWS 2016-06-27 17:07:26 +02:00
Christoph M. Becker 57940605da Fix #70628: Clearing bindings on an SQLite3 statement doesn't work
Obiously, it isn't sufficient to call sqlite3_clear_bindings() alone, but
also the bound_params of the php_sqlite3_stmt have to be cleared.
2016-06-27 17:06:27 +02:00
Stanislav Malyshev cab1c3b370 Fixed bug #72479 - same as #72434 2016-06-26 18:02:58 -07:00
Lior Kaplan ad32c7b538 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add CVE info for PHP 5.6.22
  Add CVE info for PHP 5.6.23
  Add missing entries for PHP 5.6.23
2016-06-25 21:32:38 +03:00
Lior Kaplan d826bdf1c7 Align NEWS files with 7.0.8 and Changelog 2016-06-25 21:25:57 +03:00
Lior Kaplan b4873e57b4 Add CVE info for PHP 5.6.22 2016-06-25 20:31:26 +03:00
Lior Kaplan 6bd527771c Add CVE info for PHP 5.6.23 2016-06-25 20:28:51 +03:00
Lior Kaplan 02c24be8e4 Add missing entries for PHP 5.6.23 2016-06-25 19:56:00 +03:00
Xinchen Hui 0183a9af5a Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify router.php) 2016-06-24 18:08:16 -07:00
Xinchen Hui 53de1c2830 Fixed format 2016-06-24 21:13:04 +08:00
Anatol Belski 056c2ce349 yet another test rewrite 2016-06-23 09:42:17 +02:00
Xinchen Hui bd74e7d013 Fixed bug #72476 (Memleak in jit_stack) 2016-06-23 14:06:48 +08:00
Anatol Belski f90c832cb2 update NEWS 2016-06-22 20:19:09 +02:00
Anatol Belski 4edbac6ec5 rewrite test 2016-06-22 19:46:02 +02:00
Anatol Belski e453904251 Fixed bug #72463 mail fails with invalid argument 2016-06-22 19:06:33 +02:00
Dmitry Stogov 3c84e5e1ce Allow "proxy" ovjects to substitute their class names through get_class_name() handler (similar to var_dump() and others). 2016-06-22 17:23:04 +03:00
Anatol Belski c196f9cdf7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test cleanup
2016-06-22 12:22:03 +02:00
Anatol Belski 4638ba9c07 fix test cleanup 2016-06-22 12:20:02 +02:00
Anatol Belski 98f6248dcf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix dir separator in test
2016-06-22 11:44:14 +02:00
Anatol Belski de1c407348 fix dir separator in test 2016-06-22 11:41:05 +02:00
Ferenc Kovacs 63d5e21f42 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-22 03:08:10 +02:00
Ferenc Kovacs ba980d0a62 update NEWS 2016-06-22 03:03:01 +02:00
Anatol Belski ed10168b30 fix two remaining tests 2016-06-21 17:24:08 +02:00
Anatol Belski 1d5a4520be Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test
2016-06-21 16:22:51 +02:00
Anatol Belski e3bd360ec9 fix test
There is a difference between TS and NTS warning message, since
virtual_mkdir vs glibc directly is used. This has no effect for
the actual fix functionality.
2016-06-21 16:20:03 +02:00
Anatol Belski 5a9f0c77ad re-fix leak 2016-06-21 15:21:58 +02:00
Anatol Belski 7002c32809 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  re-fix leak
  Revert "fix leak"
2016-06-21 15:21:26 +02:00
Anatol Belski a00350486f re-fix leak 2016-06-21 15:18:10 +02:00
Anatol Belski 9a9249a8d0 Revert "fix leak"
This reverts commit 757105e2a2.
2016-06-21 14:58:15 +02:00
Anatol Belski e6cc30e167 Revert "fix leak"
This reverts commit c5d9c50897.
2016-06-21 14:51:43 +02:00
Anatol Belski e8f2315a00 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-06-21 13:26:34 +02:00
Anatol Belski 757105e2a2 fix leak 2016-06-21 13:26:12 +02:00
Julien Pauli 155619184f 5.5.38 now 2016-06-21 13:10:37 +02:00
Anatol Belski c5d9c50897 fix leak 2016-06-21 12:29:41 +02:00
Remi Collet 69fd1133d0 bump zip version 2016-06-21 11:16:21 +02:00
Anatol Belski 722ed4c757 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  remove the huge test file, generate it on the fly instead
  remove the huge test file, generate it on the fly instead
2016-06-21 09:54:34 +02:00
Anatol Belski 6d7500c14c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  remove the huge test file, generate it on the fly instead
2016-06-21 09:53:04 +02:00
Anatol Belski 2af71a04b0 remove the huge test file, generate it on the fly instead 2016-06-21 09:48:11 +02:00
Anatol Belski fd93c8601d remove the huge test file, generate it on the fly instead 2016-06-21 09:45:26 +02:00
Anatol Belski 0c7250f260 remove the huge test file, generate it on the fly instead 2016-06-21 09:42:38 +02:00
Stanislav Malyshev 7c389e8429 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Now the right bug #
  Fix NEWS

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:28:17 -07:00
Stanislav Malyshev 5b90a8bd7c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Now the right bug #
  Fix NEWS
2016-06-21 00:27:46 -07:00
Stanislav Malyshev 8705254f2d Merge branch 'PHP-7.0.8' into PHP-7.0
* PHP-7.0.8:
  iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1
  fix NEWS
  set versions

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:25:49 -07:00
Stanislav Malyshev 2a65544f78 Merge branch 'PHP-5.6.23' into PHP-7.0.8
* PHP-5.6.23: (24 commits)
  iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1
  Fix bug #72140 (segfault after calling ERR_free_strings())
  ...

Conflicts:
	configure.in
	ext/mbstring/php_mbregex.c
	ext/mcrypt/mcrypt.c
	ext/spl/spl_array.c
	ext/spl/spl_directory.c
	ext/standard/php_smart_str.h
	ext/standard/string.c
	ext/standard/url.c
	ext/wddx/wddx.c
	ext/zip/php_zip.c
	main/php_version.h
2016-06-21 00:24:32 -07:00
Stanislav Malyshev fc0b0afdc3 Now the right bug # 2016-06-21 00:18:27 -07:00
Stanislav Malyshev 2af6dded37 Fix NEWS 2016-06-21 00:14:56 -07:00
Stanislav Malyshev c9b24ef307 Merge branch 'PHP-5.6.23' into PHP-5.6
* PHP-5.6.23:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  Fix bug #72321 - use efree() for emalloc allocation
  5.6.23RC1

Conflicts:
	configure.in
	main/php_version.h
2016-06-21 00:02:37 -07:00
Stanislav Malyshev 7dde353ee7 Merge branch 'PHP-5.5' into PHP-5.6.23
* PHP-5.5:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now

Conflicts:
	configure.in
	ext/mcrypt/mcrypt.c
	ext/spl/spl_directory.c
	main/php_version.h
2016-06-21 00:01:48 -07:00
Stanislav Malyshev c395c6e5d7 iFixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow 2016-06-20 23:58:26 -07:00
Stanislav Malyshev b028cacf31 update NEWS 2016-06-20 23:45:37 -07:00
Stanislav Malyshev e1d2f86a41 Merge branch 'PHP-5.5.37' into PHP-5.5
* PHP-5.5.37:
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
2016-06-20 23:31:54 -07:00
Stanislav Malyshev 5f107ab8a6 fix tests 2016-06-20 22:54:55 -07:00
Stanislav Malyshev 7f428cae88 fix build 2016-06-20 22:13:31 -07:00
Stanislav Malyshev 6c5211a0ce Fix bug #72455: Heap Overflow due to integer overflows 2016-06-20 21:51:42 -07:00
Stanislav Malyshev f6aef68089 Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize 2016-06-20 21:35:22 -07:00
Stanislav Malyshev 3f627e580a Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize 2016-06-20 21:26:33 -07:00
Remi Collet d002037dc1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA)
2016-06-20 18:44:39 +02:00
Remi Collet 1b4570b79f Fix bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA) 2016-06-20 18:43:07 +02:00
Christoph M. Becker 4cde87b5b6 Update NEWS 2016-06-20 15:28:41 +02:00
Christoph M. Becker 5cc924e5c2 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-20 15:20:58 +02:00
Christoph M. Becker b3f3cd5903 Update NEWS 2016-06-20 15:18:47 +02:00
Christoph M. Becker 4b4275059f Fix #64641: imagefilledpolygon doesn't draw horizontal line
As has been reported, 1-dimensional horizontal filled polygons are not drawn
at all. That is caused by the scanline algorithm used for drawing filled
polygons which skips the drawing of horizontal edges, because that is
normally not necessary. If, however, the polygon consists of horizontal
edges only, that obviously doesn't work, so we add a special case handling.

That has also been fixed in libgd with
<https://github.com/libgd/libgd/commit/f9f10fa9>.
2016-06-20 15:17:52 +02:00
Stanislav Malyshev 0925e7239d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
2016-06-18 22:13:16 -07:00
Stanislav Malyshev 58797ab895 Update NEWS 2016-06-18 22:13:04 -07:00
Stanislav Malyshev 8c0133f0eb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72447: Type Confusion in php_bz2_filter_create()

Conflicts:
	ext/bz2/bz2_filter.c
2016-06-18 22:11:23 -07:00
Stanislav Malyshev 42b2d7fec5 Fix bug #72447: Type Confusion in php_bz2_filter_create() 2016-06-18 22:10:22 -07:00
Stanislav Malyshev b9ec171e7d Fix bug #72407: NULL Pointer Dereference at _gdScaleVert 2016-06-18 21:57:25 -07:00
Stanislav Malyshev 5b597a2e5b Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free 2016-06-18 21:48:39 -07:00
Xinchen Hui af2c332f41 Update NEWS 2016-06-18 21:34:12 -07:00
Xinchen Hui 6b83832cf4 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	main/streams/xp_socket.c
2016-06-18 21:33:54 -07:00
Xinchen Hui c4c1993af6 Fixed bug #72439 (Stream socket with remote address leads to a segmentation fault) 2016-06-18 21:29:47 -07:00
Stanislav Malyshev e9ac8954be Fix bug #72298 pass2_no_dither out-of-bounds access 2016-06-18 21:06:09 -07:00
Pierre Joye 7722455726 Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow 2016-06-18 20:15:10 +02:00
Christoph M. Becker cc64702796 Update NEWS 2016-06-17 18:00:24 +02:00
Christoph M. Becker eb456d2d27 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-17 17:52:10 +02:00
Christoph M. Becker ed0ec66996 Fix #53640: XBM images require width to be multiple of 8 2016-06-17 17:50:36 +02:00
Xinchen Hui 958f18c1a1 Fixed "implicit declaration of function ‘msgformat_fix_quotes’" 2016-06-17 15:59:41 +08:00
Jakub Zelenka 307e546e1a Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 20:11:54 +01:00
Jakub Zelenka 0c34f53c93 Fix incorrect error suppressing in openssl_error_string test 2016-06-16 20:11:02 +01:00
Jakub Zelenka 84948e6382 Fix occasionally failing OpenSSL DH bug test
The test was failing when first byte was 0
2016-06-16 20:09:17 +01:00
Christoph M. Becker cc8ffa6911 Update NEWS 2016-06-16 14:33:41 +02:00
Christoph M. Becker 12230c66b1 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 14:32:10 +02:00
Christoph M. Becker 5f4113edb3 Update NEWS 2016-06-16 14:26:45 +02:00
Christoph M. Becker 60feda4ea4 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-16 14:06:39 +02:00
Christoph M. Becker 8aa511f1fc Fix #43475: Styled thick horizontal lines are scrambled
Thick lines are drawn by gdImageFilledRectangle(), which iterates over
the x ordinate first (Z order) to apply the style pattern. While this works
fine for vertical and diagonal lines, it obviously fails for horizontal
lines, which have to be iterated over in N order.

To fix this bug, we introduce the helpers  gdImageFilled(H|V)Rectangle(),
which may be reused for other purposes as well.

This is basically the same fix as libgd/libgd/c2b91dbc.
2016-06-16 13:59:00 +02:00
Stanislav Malyshev 7245bff300 Fix bug #72262 - do not overflow int 2016-06-15 21:58:26 -07:00
Stanislav Malyshev 88746d60ab Fix bug #72400 and #72403 - prevent signed int overflows for string lengths 2016-06-15 21:51:28 -07:00
Derick Rethans 8267a5fba7 Fixed expected test outcome due to rule changes 2016-06-15 18:31:41 +01:00
Derick Rethans 76ec139a0a Merge branch 'PHP-5.6' into PHP-7.0 2016-06-15 18:30:03 +01:00
Derick Rethans e0e83c0180 Fixed expected test outcome due to rule changes 2016-06-15 18:29:40 +01:00
Derick Rethans 020541587a Updated to version 2016.5 (2016e) 2016-06-15 11:58:50 +01:00
Derick Rethans a1db72d519 Empty merge 2016-06-15 11:58:49 +01:00
Derick Rethans fffa1aa0f3 Updated to version 2016.5 (2016e) 2016-06-15 11:58:47 +01:00
Xinchen Hui c3fc4194ea Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Maybe fix bug #72011
  Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
  Fix bug #72138 - Integer Overflow in Length of String-typed ZVAL
2016-06-15 14:56:07 +08:00
Xinchen Hui 999a3553d5 Fixed(attempt to) bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) - oob read access)
according to ext/mbstring/oniguruma/enc/utf8.c, max bytes are 6
2016-06-15 14:54:57 +08:00
Nikita Popov 93f7939891 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/date/php_date.c
2016-06-14 22:38:44 +02:00
Nikita Popov 248fdfcf73 Maybe fix bug #72011 2016-06-14 22:37:27 +02:00
Stanislav Malyshev 49b1290617 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
2016-06-14 10:50:45 -07:00
Bartosz Dziewoński 1ab5a1b432 Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
When the location of the data is outside of the range we have
preloaded (for example, if it's before the beginning of the IFD
structure), we have to read it from the stream into a separate buffer.
The offset calculations in this case were incorrect, resulting in
bogus values being read for the affected fields (sometimes parts of
other fields, sometimes binary data).

The included test image, sourced from [1], is in the public domain.

[1] https://commons.wikimedia.org/wiki/File:U.S._Marines_Prepare_to_board_an_MV-22_Osprey_160509-M-AF202-041.jpg
2016-06-14 10:48:08 -07:00
Stanislav Malyshev 79fc877290 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72138 - Integer Overflow in Length of String-typed ZVAL
2016-06-14 01:03:37 -07:00
Stanislav Malyshev 4c968c6ddd Fix bug #72138 - Integer Overflow in Length of String-typed ZVAL 2016-06-14 01:03:03 -07:00
Stanislav Malyshev 489fd56fe3 Fix bug #72275: don't allow smart_str to overflow int 2016-06-14 00:02:17 -07:00
Xinchen Hui 3d56418722 Fixed bug #72399 (Use-After-Free in MBString (search_re)) 2016-06-13 18:20:26 -07:00
Xinchen Hui d1ab974f0b Fixed bug #72306 (Heap overflow through proc_open and $env parameter) 2016-06-13 21:08:04 +08:00
Anatol Belski d3bdbe6395 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now
2016-06-13 08:19:19 +02:00
Stanislav Malyshev a44c89e8af Fix bug #72340: Double Free Courruption in wddx_deserialize 2016-06-12 23:18:23 -07:00
Anatol Belski 93e8f59aab Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now
2016-06-13 08:15:31 +02:00
Anatol Belski 6f73079ce1 update NEWS 2016-06-13 08:12:22 +02:00
Christoph M. Becker f96ebb0986 Fix #66387: Stack overflow with imagefilltoborder
The stack overflow is caused by the recursive algorithm in combination with a
very large negative coordinate passed to gdImageFillToBorder(). As there is
already a clipping for large positive coordinates to the width and height of
the image, it seems to be consequent to clip to zero also.
2016-06-13 08:10:36 +02:00
Stanislav Malyshev d144590d38 Fix bug #72321 - use efree() for emalloc allocation 2016-06-12 21:35:13 -07:00
Jakub Zelenka a2f4c32eb1 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-12 18:39:32 +01:00
Jakub Zelenka 0e2447cd11 Fix bug #71915 (openssl_random_pseudo_bytes is not fork-safe)
Add time to the entropy before using RAND_bytes
2016-06-12 18:14:21 +01:00
Jakub Zelenka 54310d95f9 Fix bug #72336 (openssl_pkey_new does not fail for invalid DSA params) 2016-06-12 18:14:21 +01:00
Jakub Zelenka 4056edd20d Update openssl_error_string to run and be more forgiving 2016-06-12 18:14:21 +01:00
Christoph M. Becker 5d57e25579 Fix #71554: FTP has not built-in support 2016-06-12 13:22:02 +02:00
Christoph M. Becker 07a793810f Merge branch 'PHP-5.6' into PHP-7.0 2016-06-09 15:35:28 +02:00
Christoph M. Becker 1f7cc24df7 Merge branch 'pull-request/1930' into PHP-5.6 2016-06-09 15:28:58 +02:00
Dmitry Stogov bfcf32237e Fixed bug #72369 (array_merge() produces references in PHP7) 2016-06-09 15:07:44 +03:00
Ferenc Kovacs 0307315769 5.6.23RC1 2016-06-09 10:54:35 +02:00
Ferenc Kovacs 65b6950a56 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  5.6.24 will be next
2016-06-09 10:52:26 +02:00
Ferenc Kovacs c26097c2f1 5.6.24 will be next 2016-06-09 10:51:02 +02:00
Jakub Zelenka 84dce33b04 Merge branch 'PHP-5.6' into PHP-7.0 2016-06-08 18:36:36 +01:00
Jakub Zelenka 05033c9ebd Fix bug #72140 (segfault after calling ERR_free_strings()) 2016-06-08 18:21:39 +01:00
Pierre Joye ced675de22 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-06-08 11:08:05 +07:00
Pierre Joye 4d81bf937f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prevent invalid color index (palette only), may lead to crash
  Add CVE to #66387
  add missing NEWS entry
2016-06-08 11:07:32 +07:00
Pierre Joye 6d3fa654b7 prevent invalid color index (palette only), may lead to crash 2016-06-08 11:06:48 +07:00
Lior Kaplan e6211038cb Add CVE to #66387 2016-06-07 21:46:59 +03:00
Lior Kaplan 48d629eb45 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add CVE to #66387
2016-06-07 21:46:25 +03:00
Lior Kaplan 62f9d1e3ae Add CVE to #66387 2016-06-07 21:45:24 +03:00
Anatol Belski 18f30d702c fix NEWS 2016-06-07 18:53:18 +02:00
Anatol Belski 3473406b2a Merge branch 'PHP-7.0' into PHP-7.0.8
* PHP-7.0:
  fix NEWS
  add missing NEWS entry
  update NEWS
  #72337 invalid dimensions can lead to segv
  7.0.9 next

Conflicts:
	configure.in
	main/php_version.h
2016-06-07 18:51:34 +02:00
Anatol Belski 7935a1e2ff fix NEWS 2016-06-07 18:44:40 +02:00
Anatol Belski 74d8429f53 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add missing NEWS entry
2016-06-07 18:42:55 +02:00
Anatol Belski 1d0f128351 add missing NEWS entry 2016-06-07 18:41:17 +02:00
Pierre Joye 99f8a5587b update NEWS 2016-06-07 17:40:55 +07:00
Pierre Joye 3071ba1ff8 Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-06-07 17:38:41 +07:00
Pierre Joye 1bbd7fc7eb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  #72337 invalid dimensions can lead to segv
2016-06-07 17:18:14 +07:00
Pierre Joye f80125950c #72337 invalid dimensions can lead to segv 2016-06-07 17:16:40 +07:00
Anatol Belski 407850e8c1 set versions 2016-06-07 10:10:16 +02:00
Anatol Belski 041210f441 7.0.9 next 2016-06-07 10:04:25 +02:00
Anatol Belski edb8c3f6e3 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add test for bug #53735
2016-06-06 21:07:45 +02:00
Anatol Belski 2a0ed8a2eb Add test for bug #53735 2016-06-06 21:06:06 +02:00
Anatol Belski 3e6c02b91a fix ibase handle initialization, mostly compiler warnings 2016-06-06 13:30:17 +02:00
Anatol Belski 174c3371bd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix typo
2016-06-06 08:58:08 +02:00
Anatol Belski eaef8f6db2 fix typo 2016-06-06 08:56:40 +02:00
Anatol Belski 075c75873e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix broken skipif and add xfail for now
2016-06-06 08:21:39 +02:00
Anatol Belski 1b2afd478b fix broken skipif and add xfail for now 2016-06-06 08:20:01 +02:00
Anatol Belski 6ec8b2c57d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  missing return
2016-06-06 07:33:36 +02:00
Anatol Belski c05b417718 missing return 2016-06-06 07:28:12 +02:00
Jakub Zelenka 1f7535234e Merge branch 'PHP-5.6' into PHP-7.0 2016-06-05 17:30:03 +01:00
Jakub Zelenka d4615d1118 Add new test for openssl_pkey_new 2016-06-05 17:27:47 +01:00
Jakub Zelenka 497fe33d6f Add test for openssl_error_string
This test is important for making sure that the error strings
from OpenSSL works as expected and we can safely add a fix
for storing the strings that is prepared.
2016-06-05 17:23:05 +01:00
Jakub Zelenka 5e9f387175 Remove openssl_x509_parse for OpenSSL 0.9.x
The test is unstable and it actually fails with latest 0.9.8
2016-06-05 16:28:50 +01:00
Raphaël Tournoy 1dfdae6de4 fix typo 2016-06-03 17:18:14 +02:00
Anatol Belski f2bc71e43d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fixed bug #70484 selectordinal doesn't work with named parameters
2016-06-02 12:20:46 +02:00
Anatol Belski 2004c25790 update NEWS 2016-06-02 12:18:33 +02:00
Anatol Belski 22336db97f Fixed bug #70484 selectordinal doesn't work with named parameters 2016-06-02 12:17:42 +02:00
Anatol Belski 48ca6dfc70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix ODBC bug for varchars returning with length zero
2016-06-02 12:07:54 +02:00
Elizabeth Marie Smith 72c9324d70 Fix ODBC bug for varchars returning with length zero 2016-06-02 12:04:10 +02:00
Xinchen Hui 31ce3a661a Fixed bug #72308 (fastcgi_finish_request and logging environment variables) 2016-06-02 14:16:32 +08:00
Anatol Belski 51cb58e709 update NEWS 2016-06-01 14:08:32 +02:00
Anatol Belski 79b978db9a Add test for bug #72294 2016-06-01 11:55:35 +02:00
Anatol Belski af8fa8e937 Fixed bug #72294 Segmentation fault/invalid pointer in connection with pgsql_stmt_dtor 2016-06-01 11:55:35 +02:00
Xinchen Hui cf1ad54b64 Also include ini_get 2016-06-01 10:46:04 +08:00
Xinchen Hui f5bc7e881b Forgotten test script for bug #72300 2016-06-01 10:43:53 +08:00
Anatol Belski 1d4d8c7436 fix test portability 2016-05-31 18:42:40 +02:00
Xinchen Hui f2a814df33 Fixed bug #72300 (ignore_user_abort(false) has no effect) 2016-05-31 07:24:02 -07:00
Xinchen Hui 953ee61a49 No sure why this is failed in travis 2016-05-31 17:22:47 +08:00
Xinchen Hui 47fa763fae Fixed test (keyword is local related) 2016-05-31 16:55:58 +08:00
Xinchen Hui 072bc589fc Attempt to fix tests fails 2016-05-31 16:48:19 +08:00
Xinchen Hui d1dd9b4558 Re-Fixed bug #72155 (use-after-free caused by get_zval_xmlrpc_type) 2016-05-31 11:44:20 +08:00
Xinchen Hui a811b5e38d Revert "fix #72155 (use-after-free caused by get_zval_xmlrpc_type)"
This reverts commit 1690dcb827.
2016-05-31 11:32:09 +08:00
Anatol Belski 2524ab9e67 fix condition 2016-05-30 18:35:14 +02:00
Anatol Belski c101690972 update NEWS 2016-05-30 14:10:27 +02:00
Bob Weinand 67468fb417 Fixed bug #72284 (phpdbg fatal errors with coverage)
Cherry-pick of original commits d3371b and 0f20e11 only present in master
2016-05-30 13:31:17 +02:00
Anatol Belski 933d6b188c fix test title 2016-05-30 12:48:00 +02:00
Anatol Belski 97c530fece Add test for bug #72258 2016-05-30 12:47:04 +02:00
Anatol Belski f6e79af3ef update UPGRADING 2016-05-30 10:32:43 +02:00
Anatol Belski 2c80459c24 Expose missing flags from libzip at least >= 0.11.x
These are helpful with reading/writing zips containing non UTF-8
filenames to mitigate possibly changed libzip behaviors.

Partial cherry-pick of 893c2405ff
2016-05-30 10:32:43 +02:00
Joe Watkins 1690dcb827 fix #72155 (use-after-free caused by get_zval_xmlrpc_type) 2016-05-30 08:56:50 +01:00
Joe Watkins 0c5bd4d445 This is exported at implementation site, but no forward declaration can cause compile warnings 2016-05-29 06:02:38 +01:00
Nikita Popov 4746e5efcb Forbid "yield from" in force closed generators
Same check we do for "yield", was missed when "yield from" was
added. We could make this more granular by only forbidding to
actually yield values and still allow something like "yield from []",
but this does not seem worthwhile.
2016-05-28 13:21:05 +02:00
Xinchen Hui d29bd582a8 Added NEWS Entry 2016-05-28 16:12:10 +08:00
Lauri Kenttä 58302192b7 Test for bug #72221, segfault in zend_memnstr_ex 2016-05-28 16:10:29 +08:00
Lauri Kenttä 287f9489d8 Fix bug #72221 (segfault, past-the-end access) 2016-05-28 16:10:16 +08:00
Ferenc Kovacs cc0d237664 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-05-26 03:05:52 +02:00
Ferenc Kovacs 6e5958e37d update NEWS 2016-05-26 03:05:06 +02:00
Adam Harvey c523dfdb49 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix typo in phpdbg help.
2016-05-25 12:47:49 -05:00
Adam Harvey 54eb659032 Fix typo in phpdbg help.
Sorry, I would have included this in the last push had I spotted it a
minute earlier.
2016-05-25 12:47:35 -05:00
Adam Harvey ac29f9de86 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Add missing newlines to phpdbg's help for the run command.
2016-05-25 12:40:23 -05:00
Adam Harvey e623e91e27 Add missing newlines to phpdbg's help for the run command.
This is not at all related to needing screenshots for a talk I'm giving
in two days. No sir. Not at all.
2016-05-25 12:38:41 -05:00
Remi Collet 4dd03651f3 Skip test which is 64bits only
Diff from test output
001+ Warning: fread(): Length parameter must be greater than 0 in ...
001- Warning: fread(): Length parameter must be no more than 2147483647 in ...
2016-05-25 16:40:52 +02:00
Remi Collet 815b5fe7ae Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Skip test which is 64bits only
2016-05-25 16:19:52 +02:00
Remi Collet ce932f6479 Skip test which is 64bits only
Diff from test output
001+ Warning: fread(): Length parameter must be greater than 0 in ...
001- Warning: fread(): Length parameter must be no more than 2147483647 in ...
2016-05-25 16:17:12 +02:00
Julien Pauli 0c84740450 5.5.37 now 2016-05-25 11:37:58 +02:00
Anatol Belski 1f3f46cc60 update NEWS 2016-05-25 11:30:00 +02:00
Anatol Belski 02a3a93f9b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test portability
2016-05-25 11:21:16 +02:00
Anatol Belski 65a2c451bb fix test portability 2016-05-25 11:19:19 +02:00
Anatol Belski 8dab872a43 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.22RC1
2016-05-25 11:15:39 +02:00
Stanislav Malyshev 2fe563e8d8 Merge branch 'PHP-7.0.7' into PHP-7.0
* PHP-7.0.7:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  set versions
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	configure.in
	main/php_version.h
2016-05-24 20:51:52 -07:00
Stanislav Malyshev 3ed0114e7f Merge branch 'PHP-5.5' into PHP-7.0.7
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/intl/locale/locale_methods.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
	ext/standard/file.c
	ext/standard/html.c
2016-05-24 18:05:06 -07:00
Stanislav Malyshev 2464b092eb Merge branch 'PHP-5.6.22' into PHP-5.6
* PHP-5.6.22:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  prepare for 5.6.22RC1
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	configure.in
	main/php_version.h
2016-05-24 17:21:22 -07:00
Stanislav Malyshev 544940c48a Merge branch 'PHP-5.5' into PHP-5.6.22
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
2016-05-24 16:56:36 -07:00
Stanislav Malyshev 9a826a3bd9 Fix memory leak in imagescale() 2016-05-24 16:12:01 -07:00
Stanislav Malyshev f423e1bb89 Update NEWS 2016-05-24 15:56:02 -07:00
Stanislav Malyshev e955913115 Better fix for bug #72135 2016-05-24 15:52:15 -07:00
Stanislav Malyshev 7a1aac3343 Fixed bug #72227: imagescale out-of-bounds read
Ported from https://github.com/libgd/libgd/commit/4f65a3e4eedaffa1efcf9ee1eb08f0b504fbc31a
2016-05-23 00:34:35 -07:00
Stanislav Malyshev 97eff7eb57 Fix bug #72241: get_icu_value_internal out-of-bounds read 2016-05-22 17:49:02 -07:00
Derick Rethans c572968900 Merge branch 'PHP-5.6' into PHP-7.0 2016-05-18 12:19:49 +01:00
Derick Rethans f43f6fc39b Fixed bug #63740 (strtotime seems to use both sunday and monday as start of week) 2016-05-18 12:19:11 +01:00
Dmitry Stogov d41920c57d Use PHP_VERSION as OPcahce version 2016-05-17 17:16:10 +03:00
Xinchen Hui 2eb7e75c25 Let's only read-only here 2016-05-17 18:07:20 +08:00
Xinchen Hui 7989db975f Fixed bug #72229 (Wrong reference when serialize/unserialize an object) 2016-05-17 17:40:26 +08:00
Anatol Belski 7e5ea3c305 update NEWS 2016-05-16 19:30:38 +02:00
Thomas Punt 0e21742bf8 Tidy up 2016-05-16 19:15:40 +02:00
Thomas Punt 367fde9947 Remove unnecessary boundary checks 2016-05-16 19:15:40 +02:00
Thomas Punt 39052d4d75 Resolve bug #72017 2016-05-16 19:15:40 +02:00
Xinchen Hui 6f4860545b Revert "Revert the ABI break commit"
This reverts commit 07220f615b.
2016-05-16 06:23:55 -07:00
Xinchen Hui 0b3a4c6101 Revert "Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)""
obviously I read the change is in argument lists by mistake :<

This reverts commit 9e7afa7514.
2016-05-16 06:22:13 -07:00
Xinchen Hui 8578fb994b Correct name, it was typed in habitually 2016-05-16 14:48:13 +08:00
Stanislav Malyshev 0da8b8b801 Fix bug #72135 - don't create strings with lengths outside int range 2016-05-15 23:26:51 -07:00
Xinchen Hui 07220f615b Revert the ABI break commit 2016-05-16 11:24:39 +08:00
Xinchen Hui 9e7afa7514 Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)"
ABI break

This reverts commit fb951553be.
2016-05-16 11:24:16 +08:00
Xinchen Hui 1559fd7e48 Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes) 2016-05-16 11:19:45 +08:00
Joe Watkins fb951553be fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs) 2016-05-14 08:20:41 +01:00
Joe Watkins b165114013 fix #72206 (xml_parser_create/xml_parser_free leaks mem) 2016-05-14 08:10:16 +01:00
Joe Watkins 1524e00ccc improve 7132fe19c2 2016-05-13 12:47:36 +01:00
Joe Watkins 7132fe19c2 fix 1bb8a7b0b8 2016-05-13 09:25:15 +01:00
Joe Watkins 1bb8a7b0b8 fix #72180 (Env variables incorrectly pretty printed in config.nice, phpinfo) 2016-05-13 07:41:11 +01:00
Anatol Belski f751b1ceaf fix dir separator in test 2016-05-12 20:37:04 +02:00
Anatol Belski d33f258495 update NEWS 2016-05-12 13:39:15 +02:00
Anatol Belski 9f50bb5bfa workaround the extra new line in the test out on another env 2016-05-12 12:45:04 +02:00
Anatol Belski 7f6e285430 Fixed bug #72197 pg_lo_create arbitrary read 2016-05-12 11:40:28 +02:00
Xinchen Hui 3797e570b2 Added NEWS entry missed while doing merge 2016-05-12 13:48:24 +08:00
Xinchen Hui 92828ae204 Committed by accident 2016-05-12 13:40:22 +08:00
Xinchen Hui d1926742aa Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix serializing ZEND_AST_SHELL_EXEC
  add missing NEWS entry
  prepare for 5.6.22RC1
  add missing NEWS entry
2016-05-12 13:16:07 +08:00
Xinchen Hui 3c0341e6f9 Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free) 2016-05-12 13:15:33 +08:00
Sara Golemon a73b03edea Fix serializing ZEND_AST_SHELL_EXEC
Currently, `foo` is reserialized as `'foo'` due to misuse of zend_ast_export().
ZEND_AST_SHELL_EXEC can only contain ZEND_AST_ZVAL(string) or ZEND_AST_ENCAPS_LIST,
so just handle the ZEND_AST_ZVAL(string) case directly.
2016-05-12 02:47:56 +00:00
Ferenc Kovacs fe6af26e2d prepare for 5.6.22RC1 2016-05-11 23:34:15 +02:00
Ferenc Kovacs 414eb83460 add missing NEWS entry 2016-05-11 23:31:52 +02:00
Ferenc Kovacs edcc97df39 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  prepare for 5.6.22RC1
  add missing NEWS entry
2016-05-11 23:31:09 +02:00
Ferenc Kovacs 0815f7f755 prepare for 5.6.22RC1 2016-05-11 23:30:04 +02:00
Ferenc Kovacs 89e4862e5f add missing NEWS entry 2016-05-11 23:29:23 +02:00
Xinchen Hui df404e2e0e Fixed Bug #72193 (dns_get_record returns array containing elements of type 'unknown') 2016-05-11 17:31:46 +08:00
Xinchen Hui 66ad4fc393 Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound) 2016-05-11 11:12:27 +08:00
Derick Rethans c35bd4861d Allow for special case for the opcache zend extension 2016-05-10 15:40:03 -04:00
Anatol Belski 0718aa5833 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix handle leak
2016-05-10 20:02:17 +02:00
Anatol Belski 6b63d80a7a fix handle leak 2016-05-10 19:59:48 +02:00
Dmitry Stogov f7372f648f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  The "flock" structure has to be writable on AIX.
2016-05-10 17:53:33 +03:00
Dmitry Stogov 90f43caf5b The "flock" structure has to be writable on AIX. 2016-05-10 17:50:14 +03:00
Anatol Belski 09dae4dc85 prepare next 7.0.8 2016-05-10 13:06:55 +02:00
Stanislav Malyshev 41fc3c76e9 Add check for string overflow to all string add operations 2016-05-09 22:17:20 -07:00
Stanislav Malyshev abd159cce4 Fix bug #72114 - int/size_t confusion in fread 2016-05-09 21:55:29 -07:00
Julien Pauli 95ed19ae28 Updated NEWS 2016-05-02 16:52:58 +02:00
Julien Pauli a4abd2bed9 Backport of fixed for bug #71331 - Uninitialized pointer in phar_make_dirstream() 2016-05-02 16:49:47 +02:00
Stanislav Malyshev 9649ca1630 Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream() 2016-04-28 20:57:44 +03:00
Mark Plomer f5f94d9c08 fix left-shifted/misaligned bounding-box + wrong kerning in imagettfbbox/imageftbbox
- load glyph with FT_LOAD_IGNORE_TRANSFORM for bbox as final bbox is rotated at once later (fixes "double-rotation" per glyph for calculating bbox)
- reload the rotated glyph for painting after that (only if angle != 0)
- rotate the original bbox at 0,0 and do not throw away xMin/yMin (drawing-rotation is also based at "origin" point - including the bearingX, see http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html#section-3) - this fixes the "left-shift"-problem also when angle = 0
- removed "xb/yb" and use "x/y" directly for offsetting brect (no need for adding "x1/y1" and substracting "yd" later)
- removed therefore unused "yd" helper var which seems tried to fix parts of the original problems
- initialize x/y with 0 instead of -1 in php_imagettftext_common() to make image*text() and image*bbox() results identical (there was a -1px shift in image*bbox() before)
- fixed gdroundupdown() for negative numbers (-256 / 64 gives -5 instead of -4 before)
- rotate kerning-delta by given angle (fixes completely wrong kerning and therefore wrong bounding box if angle != 0)
- changed 3 tests and added a new one to test for the new (better) coordinates
2016-04-03 12:11:26 +02:00
Paul Tarjan 9f25f736ed Dont ignore errors from FT_Get_Glyph 2016-04-03 12:11:25 +02:00
731 changed files with 85856 additions and 31033 deletions

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
; http://editorconfig.org/
root = true
[*.{c,h}]
charset = UTF-8
end_of_line = LF
indent_size = 4
indent_style = tab
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true
[*.yml]
indent_size = 2
indent_style = space
+1
View File
@@ -148,6 +148,7 @@ tests/*/*/*.sh
*/tests/*/*/*.sh
*/*/tests/*.diff
*/*/tests/*.out
*/*/tests/*.out.png
*/*/tests/*.php
*/*/tests/*.exp
*/*/tests/*.log
+3 -3
View File
@@ -108,8 +108,8 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_dblib
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Odd fixes
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
@@ -132,7 +132,7 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_oci
PRIMARY MAINTAINER: Unknown
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
+754 -3
View File
@@ -1,6 +1,747 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 May 2016 PHP 7.0.7RC1
08 Dec 2016 PHP 7.0.14
- Core:
. Fixed memory leak(null coalescing operator with Spl hash). (Tyson Andre)
. Fixded bug #72736 (Slow performance when fetching large dataset with mysqli
/ PDO). (Dmitry)
- Calendar:
. Fix integer overflows (Joshua Rogers)
- Date:
. Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
- DTrace:
. Disabled PHP call tracing by default (it makes significant overhead).
This may be enabled again using envirionment variable USE_ZEND_DTRACE=1.
(Dmitry)
- JSON:
. Fixed bug #73526 (php_json_encode depth issue). (Jakub Zelenka)
- Mysqlnd:
. Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)
- ODBC:
. Fixed bug #73448 (odbc_errormsg returns trash, always 513 bytes).
(Anatol)
- Opcache:
. Fixed bug #69090 (check cached files permissions). (dmitry)
. Fixed bug #73546 (Logging for opcache has an empty file name). (mhagstrand)
- PCRE:
. Fixed bug #73483 (Segmentation fault on pcre_replace_callback). (Laruence)
. Fixed bug #73392 (A use-after-free in zend allocator management).
(Laruence)
- PDO_Firebird:
. Fixed bug #73087, #61183, #71494 (Memory corruption in bindParam).
(Dorin Marcoci)
- Phar:
. Fixed bug #73580 (Phar::isValidPharFilename illegal memory access). (Stas)
- Postgres:
. Fixed bug #73498 (Incorrect SQL generated for pg_copy_to()). (Craig Duncan)
- Soap:
. Fixed bug #73538 (SoapClient::__setSoapHeaders doesn't overwrite SOAP
headers). (duncan3dc)
. Fixed bug #73452 (Segfault (Regression for #69152)). (Dmitry)
- SPL:
. Fixed bug #73423 (Reproducible crash with GDB backtrace). (Laruence)
- SQLite3:
. Fixed bug #73530 (Unsetting result set may reset other result set). (cmb)
- Standard:
. Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue).
(rowan dot collins at gmail dot com)
. Fixed bug #73645 (version_compare illegal write access). (Stas)
- Wddx:
. Fixed bug #73631 (Invalid read when wddx decodes empty boolean element).
(Stas)
- XML:
. Fixed bug #72135 (malformed XML causes fault) (edgarsandi)
10 Nov 2016 PHP 7.0.13
- Core:
. Fixed bug #73350 (Exception::__toString() cause circular references).
(Laruence)
. Fixed bug #73181 (parse_str() without a second argument leads to crash).
(Nikita)
. Fixed bug #66773 (Autoload with Opcache allows importing conflicting class
name to namespace). (Nikita)
. Fixed bug #66862 ((Sub-)Namespaces unexpected behaviour). (Nikita)
. Fix pthreads detection when cross-compiling (ffontaine)
. Fixed bug #73337 (try/catch not working with two exceptions inside a same
operation). (Dmitry)
. Fixed bug #73338 (Exception thrown from error handler causes valgrind
warnings (and crashes)). (Bob, Dmitry)
. Fixed bug #73329 ((Float)"Nano" == NAN). (Anatol)
- GD:
. Fixed bug #73213 (Integer overflow in imageline() with antialiasing). (cmb)
. Fixed bug #73272 (imagescale() is not affected by, but affects
imagesetinterpolation()). (cmb)
. Fixed bug #73279 (Integer overflow in gdImageScaleBilinearPalette()). (cmb)
. Fixed bug #73280 (Stack Buffer Overflow in GD dynamicGetbuf). (cmb)
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
overflow). (cmb)
. Fixed bug #72696 (imagefilltoborder stackoverflow on truecolor images).
(cmb)
- IMAP:
. Fixed bug #73418 (Integer Overflow in "_php_imap_mail" leads to crash).
(Anatol)
- OCI8
. Fixed bug #71148 (Bind reference overwritten on PHP 7). (Oracle Corp.)
- phpdbg:
. Properly allow for stdin input from a file. (Bob)
. Add -s command line option / stdin command for reading script from stdin.
(Bob)
. Ignore non-executable opcodes in line mode of phpdbg_end_oplog(). (Bob)
. Fixed bug #70776 (Simple SIGINT does not have any effect with -rr). (Bob)
. Fixed bug #71234 (INI files are loaded even invoked as -n --version). (Bob)
- Session:
. Fixed bug #73273 (session_unset() empties values from all variables in which
is $_session stored). (Nikita)
- SOAP:
. Fixed bug #73037 (SoapServer reports Bad Request when gzipped). (Anatol)
. Fixed bug #73237 (Nested object in "any" element overwrites other fields).
(Keith Smiley)
. Fixed bug #69137 (Peer verification fails when using a proxy with SoapClient)
(Keith Smiley)
- SQLite3:
. Fixed bug #73333 (2147483647 is fetched as string). (cmb)
- Standard:
. Fixed bug #73203 (passing additional_parameters causes mail to fail). (cmb)
. Fixed bug #71241 (array_replace_recursive sometimes mutates its parameters).
(adsr)
. Fixed bug #73192 (parse_url return wrong hostname). (Nikita)
- Wddx:
. Fixed bug #73331 (NULL Pointer Dereference in WDDX Packet Deserialization
with PDORow). (Stas)
13 Oct 2016 PHP 7.0.12
- Core:
. Fixed bug #73025 (Heap Buffer Overflow in virtual_popen of
zend_virtual_cwd.c). (cmb)
. Fixed bug #72703 (Out of bounds global memory read in BF_crypt triggered by
password_verify). (Anatol)
. Fixed bug #73058 (crypt broken when salt is 'too' long). (Anatol)
. Fixed bug #69579 (Invalid free in extension trait). (John Boehr)
. Fixed bug #73156 (segfault on undefined function). (Dmitry)
. Fixed bug #73163 (PHP hangs if error handler throws while accessing undef
const in default value). (Nikita)
. Fixed bug #73172 (parse error: Invalid numeric literal). (Nikita, Anatol)
. Fixed for #73240 (Write out of bounds at number_format). (Stas)
. Fixed bug #73147 (Use After Free in PHP7 unserialize()). (Stas)
. Fixed bug #73189 (Memcpy negative size parameter php_resolve_path). (Stas)
- BCmath:
. Fix bug #73190 (memcpy negative parameter _bc_new_num_ex). (Stas)
- COM:
. Fixed bug #73126 (Cannot pass parameter 1 by reference). (Anatol)
- Date:
. Fixed bug #73091 (Unserializing DateInterval object may lead to __toString
invocation). (Stas)
- DOM:
. Fixed bug #73150 (missing NULL check in dom_document_save_html). (Stas)
- Filter:
. Fixed bug #72972 (Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and
FILTER_FLAG_NO_PRIV_RANGE). (julien)
. Fixed bug #73054 (default option ignored when object passed to int filter).
(cmb)
- GD:
. Fixed bug #67325 (imagetruecolortopalette: white is duplicated in palette).
(cmb)
. Fixed bug #50194 (imagettftext broken on transparent background w/o
alphablending). (cmb)
. Fixed bug #73003 (Integer Overflow in gdImageWebpCtx of gd_webp.c). (trylab,
cmb)
. Fixed bug #53504 (imagettfbbox gives incorrect values for bounding box).
(Mark Plomer, cmb)
. Fixed bug #73157 (imagegd2() ignores 3rd param if 4 are given). (cmb)
. Fixed bug #73155 (imagegd2() writes wrong chunk sizes on boundaries). (cmb)
. Fixed bug #73159 (imagegd2(): unrecognized formats may result in corrupted
files). (cmb)
. Fixed bug #73161 (imagecreatefromgd2() may leak memory). (cmb)
- Intl:
. Fixed bug #73218 (add mitigation for ICU int overflow). (Stas)
- Mbstring:
. Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb)
. Fixed bug #66964 (mb_convert_variables() cannot detect recursion) (Yasuo)
. Fixed bug #72992 (mbstring.internal_encoding doesn't inherit default_charset).
(Yasuo)
- Mysqlnd:
. Fixed bug #72489 (PHP Crashes When Modifying Array Containing MySQLi Result
Data). (Nikita)
- Opcache:
. Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp()
function). (Laruence)
- OpenSSL:
. Fixed bug #73072 (Invalid path SNI_server_certs causes segfault).
(Jakub Zelenka)
. Fixed bug #73276 (crash in openssl_random_pseudo_bytes function). (Stas)
. Fixed bug #73275 (crash in openssl_encrypt function). (Stas)
- PCRE:
. Fixed bug #73121 (Bundled PCRE doesn't compile because JIT isn't supported
on s390). (Anatol)
. Fixed bug #73174 (heap overflow in php_pcre_replace_impl). (Stas)
- PDO_DBlib:
. Fixed bug #72414 (Never quote values as raw binary data). (Adam Baratz)
. Allow \PDO::setAttribute() to set query timeouts. (Adam Baratz)
. Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions.
(Adam Baratz)
. Add common PDO test suite. (Adam Baratz)
. Free error and message strings when cleaning up PDO instances.
(Adam Baratz)
. Fixed bug #67130 (\PDOStatement::nextRowset() should succeed when all rows
in current rowset haven't been fetched). (Peter LeBrun)
. Ignore potentially misleading dberr values. (Chris Kings-Lynne)
- phpdbg:
. Fixed bug #72996 (phpdbg_prompt.c undefined reference to DL_LOAD). (Nikita)
. Fixed next command not stopping when leaving function. (Bob)
- Session:
. Fixed bug #68015 (Session does not report invalid uid for files save handler).
(Yasuo)
. Fixed bug #73100 (session_destroy null dereference in ps_files_path_create).
(cmb)
- SimpleXML:
. Fixed bug #73293 (NULL pointer dereference in SimpleXMLElement::asXML()).
(Stas)
- SOAP:
. Fixed bug #71711 (Soap Server Member variables reference bug). (Nikita)
. Fixed bug #71996 (Using references in arrays doesn't work like expected).
(Nikita)
- SPL:
. Fixed bug #73257, #73258 (SplObjectStorage unserialize allows use of
non-object as key). (Stas)
- SQLite3:
. Updated bundled SQLite3 to 3.14.2. (cmb)
- Zip:
. Fixed bug #70752 (Depacking with wrong password leaves 0 length files).
(cmb)
15 Sep 2016 PHP 7.0.11
- Core:
. Fixed bug #72944 (Null pointer deref in zval_delref_p). (Dmitry)
. Fixed bug #72943 (assign_dim on string doesn't reset hval). (Laruence)
. Fixed bug #72911 (Memleak in zend_binary_assign_op_obj_helper). (Laruence)
. Fixed bug #72813 (Segfault with __get returned by ref). (Laruence)
. Fixed bug #72767 (PHP Segfaults when trying to expand an infinite operator).
(Nikita)
. Fixed bug #72854 (PHP Crashes on duplicate destructor call). (Nikita)
. Fixed bug #72857 (stream_socket_recvfrom read access violation). (Anatol)
- COM:
. Fixed bug #72922 (COM called from PHP does not return out parameters).
(Anatol)
- Dba:
. Fixed bug #70825 (Cannot fetch multiple values with group in ini file).
(cmb)
- FTP:
. Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with
require_ssl_reuse). (Benedict Singer)
- GD:
. Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb)
. Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor
images). (cmb)
. Fixed bug #72913 (imagecopy() loses single-color transparency on palette
images). (cmb)
. Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
- iconv:
. Fixed bug #72320 (iconv_substr returns false for empty strings). (cmb)
- IMAP:
. Fixed bug #72852 (imap_mail null dereference). (Anatol)
- Intl:
. Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
sequence). (cmb)
. Fixed bug #73007 (add locale length check). (Stas)
- Mysqlnd:
. Fixed bug #72293 (Heap overflow in mysqlnd related to BIT fields). (Stas)
- OCI8
. Fixed invalid handle error with Implicit Result Sets. (Chris Jones)
. Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones)
- Opcache:
. Fixed bug #72949 (Typo in opcache error message). (cmb)
- PDO:
. Fixed bug #72788 (Invalid memory access when using persistent PDO
connection). (Keyur)
. Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur)
. Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY
returns false). (cmb)
- PDO_DBlib:
. Implemented stringify 'uniqueidentifier' fields.
(Alexander Zhuravlev, Adam Baratz)
- PDO_pgsql:
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
specifying a sequence). (Pablo Santiago Sánchez, Matteo)
. Fixed bug #72759 (Regression in pgo_pgsql). (Anatol)
- Phar:
. Fixed bug #72928 (Out of bound when verify signature of zip phar in
phar_parse_zipfile). (Stas)
. Fixed bug #73035 (Out of bound when verify signature of tar phar in
phar_parse_tarfile). (Stas)
- Reflection:
. Fixed bug #72846 (getConstant for a array constant with constant values
returns NULL/NFC/UKNOWN). (Laruence)
- Session:
. Fixed bug #72724 (PHP7: session-uploadprogress kills httpd). (Nikita)
. Fixed bug #72940 (SID always return "name=ID", even if session
cookie exist). (Yasuo)
- SimpleXML:
. Fixed bug #72971 (SimpleXML isset/unset do not respect namespace). (Nikita)
. Fixed bug #72957 (Null coalescing operator doesn't behave as expected with
SimpleXMLElement). (Nikita)
- SPL:
. Fixed bug #73029 (Missing type check when unserializing SplArray). (Stas)
- Standard:
. Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
Kenttä)
. Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
. Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign).
(cmb)
- Streams:
. Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)
. Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails
with IIS FTP 7.5, 8.5). (vhuk)
. Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory).
(cmb)
- SQLite3:
. Downgraded bundled SQLite to 3.8.10.2. (Anatol);
- Sysvshm:
. Fixed bug #72858 (shm_attach null dereference). (Anatol)
- XML:
. Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb)
. Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
- Wddx:
. Fixed bug #72860 (wddx_deserialize use-after-free). (Stas)
. Fixed bug #73065 (Out-Of-Bounds Read in php_wddx_push_element). (Stas)
- ZIP:
. Fixed bug #68302 (impossible to compile php with zip support). (cmb)
18 Aug 2016 PHP 7.0.10
- Core:
. Fixed bug #72629 (Caught exception assignment to variables ignores
references). (Laruence)
. Fixed bug #72594 (Calling an earlier instance of an included anonymous
class fatals). (Laruence)
. Fixed bug #72581 (previous property undefined in Exception after
deserialization). (Laruence)
. Fixed bug #72496 (Cannot declare public method with signature incompatible
with parent private method). (Pedro Magalhães)
. Fixed bug #72024 (microtime() leaks memory). (maroszek at gmx dot net)
. Fixed bug #71911 (Unable to set --enable-debug on building extensions by
phpize on Windows). (Yuji Uchiyama)
. Fixed bug causing ClosedGeneratorException being thrown into the calling
code instead of the Generator yielding from. (Bob)
. Implemented FR #72614 (Support "nmake test" on building extensions by
phpize). (Yuji Uchiyama)
. Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX).
(Yuji Uchiyama)
. Fixed potential segfault in object storage freeing in shutdown sequence.
(Bob)
. Fixed bug #72663 (Create an Unexpected Object and Don't Invoke
__wakeup() in Deserialization). (Stas)
. Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas)
. Fixed bug #72683 (getmxrr broken). (Anatol)
. Fixed bug #72742 (memory allocator fails to realloc small block to large
one). (Stas)
. Fixed URL rewriter partially. It would not rewrite '//example.com/' URL
unconditionally. Only requested host(HTTP_HOST) is rewritten. (Yasuo)
- Bz2:
. Fixed bug #72837 (integer overflow in bzdecompress caused heap
corruption). (Stas)
- Calendar:
. Fixed bug #67976 (cal_days_month() fails for final month of the French
calendar). (cmb)
. Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in
zif_cal_from_jd). (cmb)
- COM:
. Fixed bug #72569 (DOTNET/COM array parameters broke in PHP7). (Anatol)
- CURL:
. Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
(Pierrick)
. Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
. Fixed bug #72674 (Heap overflow in curl_escape). (Stas)
- DOM:
. Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
- EXIF:
. Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
. Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas)
- Filter:
. Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
range). (bugs dot php dot net at majkl578 dot cz)
- FPM:
. Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user).
(gooh)
- GD:
. Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
. Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb)
. Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb)
. Fixed bug #43828 (broken transparency of imagearc for truecolor in
blendingmode). (cmb)
. Fixed bug #66555 (Always false condition in ext/gd/libgd/gdkanji.c). (cmb)
. Fixed bug #68712 (suspicious if-else statements). (cmb)
. Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
. Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Fernando, Pierre,
cmb)
- Intl:
. Fixed bug #72639 (Segfault when instantiating class that extends
IntlCalendar and adds a property). (Laruence)
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
names). (cmb)
- mbstring:
. Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
(cmb)
. Fixed bug #72693 (mb_ereg_search increments search position when a match
zero-width). (cmb)
. Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
position). (cmb)
. Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
(ju1ius)
- Mcrypt:
. Fixed bug #72782 (Heap Overflow due to integer overflows). (Stas)
- Opcache:
. Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
(Keyur)
- PCRE:
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
- PDO_pgsql:
. Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
- Reflection:
. Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
(Nikita Nefedov)
- SimpleXML:
. Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML
element). (Laruence)
- SNMP:
. Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory
allocation). (djodjo at gmail dot com)
- SPL:
. Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU)
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
character). (cmb)
. Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick)
- SQLite3:
. Fixed bug #72668 (Spurious warning when exception is thrown in user defined
function). (Laruence)
. Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash). (Laruence)
. Implemented FR #72653 (SQLite should allow opening with empty filename).
(cmb)
. Updated to SQLite3 3.13.0. (cmb)
- Standard:
. Fixed bug #72622 (array_walk + array_replace_recursive create references
from nothing). (Laruence)
. Fixed bug #72152 (base64_decode $strict fails to detect null byte).
(Lauri Kenttä)
. Fixed bug #72263 (base64_decode skips a character after padding in strict
mode). (Lauri Kenttä)
. Fixed bug #72264 (base64_decode $strict fails with whitespace between
padding). (Lauri Kenttä)
. Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
UTF chars). (cmb)
- Streams:
. Fixed bug #41021 (Problems with the ftps wrapper). (vhuk)
. Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
. Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
non-existent directories). (vhuk)
. Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade
attack). (Stas)
- XMLRPC:
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
array elements). (Laruence)
- Wddx:
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
. Fixed bug #72142 (WDDX Packet Injection Vulnerability in
wddx_serialize_value()). (Taoguang Chen)
. Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas)
. Fixed bug #72750 (wddx_deserialize null dereference). (Stas)
. Fixed bug #72790 (wddx_deserialize null dereference with invalid xml).
(Stas)
. Fixed bug #72799 (wddx_deserialize null dereference in
php_wddx_pop_element). (Stas)
- Zip:
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
(Laruence)
21 Jul 2016 PHP 7.0.9
- Core:
. Fixed bug #72508 (strange references after recursive function call and
"switch" statement). (Laruence)
. Fixed bug #72513 (Stack-based buffer overflow vulnerability in
virtual_file_ex). (Stas)
. Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
and applications). (Stas)
- bz2:
. Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
- CLI:
. Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify
router.php). (Laruence)
- COM:
. Fixed bug #72498 (variant_date_from_timestamp null dereference). (Anatol)
- Curl:
. Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
- Date:
. Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
parsing). (derick)
- Exif:
. Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
(Stas)
. Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
(Stas)
- GD:
. Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
. Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)
. Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb)
. Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
access). (Pierre)
. Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
. Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
(Pierre)
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
overflow). (Pierre)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
- Intl:
. Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
- Mbstring:
. Fixed bug #72405 (mb_ereg_replace - mbc_to_code (oniguruma) -
oob read access). (Laruence)
. Fixed bug #72399 (Use-After-Free in MBString (search_re)). (Laruence)
- mcrypt:
. Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
heap overflow in mdecrypt_generic). (Stas)
- PDO_pgsql:
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
without placeholders). (Matteo)
- PCRE:
. Fixed bug #72476 (Memleak in jit_stack). (Laruence)
. Fixed bug #72463 (mail fails with invalid argument). (Anatol)
- Readline:
. Fixed bug #72538 (readline_redisplay crashes php). (Laruence)
- Standard:
. Fixed bug #72505 (readfile() mangles files larger than 2G). (Cschneid)
. Fixed bug #72306 (Heap overflow through proc_open and $env parameter).
(Laruence)
- Session:
. Fixed bug #72531 (ps_files_cleanup_dir Buffer overflow). (Laruence)
. Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
Deserialization). (Stas)
- SNMP:
. Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
unserialize()). (Stas)
- Streams:
. Fixed bug #72439 (Stream socket with remote address leads to a segmentation
fault). (Laruence)
- XMLRPC:
. Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
simplestring.c). (Stas)
- Zip:
. Fixed bug #72520 (Stack-based buffer overflow vulnerability in
php_stream_zip_opener). (Stas)
23 Jun 2016 PHP 7.0.8
- Core:
. Fixed bug #72218 (If host name cannot be resolved then PHP 7 crashes).
(Esminis at esminis dot lt)
. Fixed bug #72221 (segfault, past-the-end access). (Lauri Kenttä)
. Fixed bug #72268 (Integer Overflow in nl2br()). (Stas)
. Fixed bug #72275 (Integer Overflow in json_encode()/json_decode()/
json_utf8_to_utf16()). (Stas)
. Fixed bug #72400 (Integer Overflow in addcslashes/addslashes). (Stas)
. Fixed bug #72403 (Integer Overflow in Length of String-typed ZVAL). (Stas)
- Date:
. Fixed bug #63740 (strtotime seems to use both sunday and monday as start of
week). (Derick)
- FPM:
. Fixed bug #72308 (fastcgi_finish_request and logging environment
variables). (Laruence)
- GD:
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
(cmb)
. Fixed bug #72298 (pass2_no_dither out-of-bounds access). (Stas)
. Fixed bug #72337 (invalid dimensions can lead to crash). (Pierre)
. Fixed bug #72339 (Integer Overflow in _gd2GetHeader() resulting in heap
overflow). (CVE-2016-5766) (Pierre)
. Fixed bug #72407 (NULL Pointer Dereference at _gdScaleVert). (Stas)
. Fixed bug #72446 (Integer Overflow in gdImagePaletteToTrueColor() resulting
in heap overflow). (CVE-2016-5767) (Pierre)
- Intl:
. Fixed bug #70484 (selectordinal doesn't work with named parameters).
(Anatol)
- mbstring:
. Fixed bug #72402 (_php_mb_regex_ereg_replace_exec - double free).
(CVE-2016-5768) (Stas)
- mcrypt:
. Fixed bug #72455 (Heap Overflow due to integer overflows). (CVE-2016-5769)
(Stas)
- OpenSSL:
. Fixed bug #72140 (segfault after calling ERR_free_strings()).
(Jakub Zelenka)
- PCRE:
. Fixed bug #72143 (preg_replace uses int instead of size_t). (Joe)
- PDO_pgsql:
. Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound).
(Laruence)
. Fixed bug #72294 (Segmentation fault/invalid pointer in connection
with pgsql_stmt_dtor). (Anatol)
- Phar:
. Fixed bug #72321 (invalid free in phar_extract_file()).
(hji at dyntopia dot com)
- Phpdbg:
. Fixed bug #72284 (phpdbg fatal errors with coverage). (Bob)
- Postgres:
. Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free). (Laruence)
. Fixed bug #72197 (pg_lo_create arbitrary read). (Anatol)
- Standard:
. Fixed bug #72369 (array_merge() produces references in PHP7). (Dmitry)
. Fixed bug #72300 (ignore_user_abort(false) has no effect). (Laruence)
. Fixed bug #72229 (Wrong reference when serialize/unserialize an object).
(Laruence)
. Fixed bug #72193 (dns_get_record returns array containing elements of
type 'unknown'). (Laruence)
. Fixed bug #72017 (range() with float step produces unexpected result).
(Thomas Punt)
- WDDX:
. Fixed bug #72340 (Double Free Courruption in wddx_deserialize).
(CVE-2016-5772) (Stas)
- XML:
. Fixed bug #72206 (xml_parser_create/xml_parser_free leaks mem). (Joe)
- XMLRPC:
. Fixed bug #72155 (use-after-free caused by get_zval_xmlrpc_type).
(Joe, Laruence)
- Zip:
. Fixed ug #72258 (ZipArchive converts filenames to unrecoverable form).
(Anatol)
. Fixed bug #72434 (ZipArchive class Use After Free Vulnerability in PHP's GC
algorithm and unserialize). (CVE-2016-5773) (Dmitry)
26 May 2016 PHP 7.0.7
- Core:
. Fixed bug #72162 (use-after-free - error_reporting). (Laruence)
@@ -23,6 +764,13 @@ PHP NEWS
- DBA:
. Fixed bug #72157 (use-after-free caused by dba_open). (Shm, Laruence)
- GD:
. Fixed bug #72227 (imagescale out-of-bounds read). (Stas)
- Intl:
. Fixed bug #64524 (Add intl.use_exceptions to php.ini-*). (Anatol)
. Fixed bug #72241 (get_icu_value_internal out-of-bounds read). (Stas)
- JSON:
. Fixed bug #72069 (Behavior \JsonSerializable different from json_encode).
(Laruence)
@@ -930,6 +1678,8 @@ PHP NEWS
- Filter:
. New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas)
. Fixed bug #67167 (Wrong return value from FILTER_VALIDATE_BOOLEAN,
FILTER_NULL_ON_FAILURE). (levim)
- FPM:
. Fixed bug #70538 ("php-fpm -i" crashes). (rainer dot jung at
@@ -945,7 +1695,8 @@ PHP NEWS
- GD:
. Fixed bug #53156 (imagerectangle problem with point ordering). (cmb)
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (cmb)
. Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874)
(cmb)
. Fixed bug #70102 (imagecreatefromwebm() shifts colors). (cmb)
. Fixed bug #66590 (imagewebp() doesn't pad to even length). (cmb)
. Fixed bug #66882 (imagerotate by -90 degrees truncates image by 1px). (cmb)
@@ -1031,7 +1782,7 @@ PHP NEWS
- ODBC:
. Fixed bug #69975 (PHP segfaults when accessing nvarchar(max) defined
columns). (cmb)
columns). (CVE-2015-8879) (cmb)
- Opcache:
. Fixed bug #70656 (require() statement broken after opcache_reset() or a
+26 -29
View File
@@ -66,7 +66,7 @@ dnl
dnl Check whether the current setup can use POSIX threads calls
dnl
AC_DEFUN([PTHREADS_CHECK_COMPILE], [
AC_TRY_RUN( [
AC_LINK_IFELSE([ AC_LANG_SOURCE([
#include <pthread.h>
#include <stddef.h>
@@ -80,18 +80,11 @@ int main() {
int data = 1;
pthread_mutexattr_init(&mattr);
return pthread_create(&thd, NULL, thread_routine, &data);
} ], [
pthreads_working=yes
} ]) ], [
pthreads_checked=yes
], [
pthreads_working=no
], [
dnl For cross compiling running this test is of no use. NetWare supports pthreads
pthreads_working=no
case $host_alias in
*netware*)
pthreads_working=yes
esac
]
pthreads_checked=no
]
) ] )dnl
dnl
dnl PTHREADS_CHECK()
@@ -129,30 +122,34 @@ else
CFLAGS="$CFLAGS $flag"
PTHREADS_CHECK_COMPILE
CFLAGS=$ac_save
if test "$pthreads_working" = "yes"; then
if test "$pthreads_checked" = "yes"; then
ac_cv_pthreads_cflags=$flag
break
fi
done
fi
fi
])
])
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
ac_cv_pthreads_lib=
if test "$pthreads_working" != "yes"; then
for lib in pthread pthreads c_r; do
ac_save=$LIBS
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
LIBS=$ac_save
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_lib=$lib
break
fi
done
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
ac_cv_pthreads_lib=
if test "$pthreads_working" != "yes"; then
for lib in pthread pthreads c_r; do
ac_save=$LIBS
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
LIBS=$ac_save
if test "$pthreads_checked" = "yes"; then
ac_cv_pthreads_lib=$lib
break
fi
done
fi
])
if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
pthreads_working="yes"
fi
fi
])
if test "$pthreads_working" = "yes"; then
threads_result="POSIX-Threads found"
+18 -2
View File
@@ -622,6 +622,12 @@ TSRM_API int shmget(int key, int size, int flags)
}
} else {
if (flags & IPC_EXCL) {
if (shm_handle) {
CloseHandle(shm_handle);
}
if (info_handle) {
CloseHandle(info_handle);
}
return -1;
}
}
@@ -665,17 +671,27 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;
if (!shm->segment) {
return (void*)-1;
}
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
err = GetLastError();
if (err) {
/* Catch more errors */
if (ERROR_NOT_ENOUGH_MEMORY == err) {
_set_errno(ENOMEM);
}
return (void*)-1;
}
shm->descriptor->shm_atime = time(NULL);
shm->descriptor->shm_lpid = getpid();
shm->descriptor->shm_nattch++;
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
return shm->addr;
}
+27
View File
@@ -442,6 +442,8 @@ Other
- Curl:
. Removed support for disabling the CURLOPT_SAFE_UPLOAD option. All curl file
uploads must use the curl_file / CURLFile APIs.
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
as a string (PHP >= 5.6.25)
- Date:
. Removed $is_dst parameter from mktime() and gmmktime().
@@ -515,6 +517,10 @@ Other
- Stream:
. Removed set_socket_blocking() in favor of its alias stream_set_blocking().
- XML:
. xml_set_object() now requires to manually unset the $parser when finished,
to avoid memory leaks.
- XSL:
. Removed xsl.security_prefs ini option. Use XsltProcessor::setSecurityPrefs()
instead.
@@ -641,6 +647,10 @@ Other
- debug_zval_dump
It prints now "int" instead of "long", and "float" instead of "double".
- getenv()
Since 7.0.9, getenv() has optional second parameter, making it only
consider local environment and not SAPI environment if true.
========================================
6. New Functions
========================================
@@ -717,6 +727,9 @@ out, that the corresponding SDK isn't available anymore.
- Openssl
minimum supported OpenSSL version series was raised to 0.9.8
- Shmop
The shmop identifiers have been changed from ints to resources of type shmop.
========================================
10. New Global Constants
========================================
@@ -740,6 +753,8 @@ out, that the corresponding SDK isn't available anymore.
. ZLIB_FINISH
- GD
. IMG_WEBP (>= 7.0.10)
. T1Lib support removed, thus lifting the optional dependency on T1Lib, the
following is therefore not available anymore:
@@ -756,6 +771,14 @@ out, that the corresponding SDK isn't available anymore.
- 'gd PS font'
- 'gd PS encoding'
- Zip
. Filename encoding flags, as of 7.0.8
- ZipArchive::FL_ENC_GUESS
- ZipArchive::FL_ENC_RAW
- ZipArchive::FL_ENC_STRICT
- ZipArchive::FL_ENC_UTF_8
- ZipArchive::FL_ENC_CP437
========================================
11. Changes to INI File Handling
========================================
@@ -807,3 +830,7 @@ out, that the corresponding SDK isn't available anymore.
of aditional information with internal functions. In PHP-5 it was possible
to use zend_function.op_array.reserved[] even for internal functions, but
now we don't allocate extra space.
- CURL
. curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
as a string (PHP >= 7.0.10)
@@ -0,0 +1,25 @@
--TEST--
Next free element may overflow in array literals
--FILE--
<?php
$i = PHP_INT_MAX;
$array = [$i => 42, new stdClass];
var_dump($array);
const FOO = [PHP_INT_MAX => 42, "foo"];
var_dump(FOO);
?>
--EXPECTF--
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
array(1) {
[%d]=>
int(42)
}
Warning: Cannot add element to the array as the next element is already occupied in %s on line %d
array(1) {
[%d]=>
int(42)
}
@@ -0,0 +1,11 @@
--TEST--
Serialization of backtick literal is incorrect
--INI--
zend.assertions=1
--FILE--
<?php
assert_options(ASSERT_WARNING);
assert(false && `echo -n ""`);
--EXPECTF--
Warning: assert(): assert(false && `echo -n ""`) failed in %s%east_serialize_backtick_literal.php on line %d
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #72496 (declare public method with signature incompatible with parent private method should not throw a warning)
--FILE--
<?php
class Foo
{
private function getFoo()
{
return 'Foo';
}
private function getBar()
{
return 'Bar';
}
private function getBaz()
{
return 'Baz';
}
}
class Bar extends Foo
{
public function getFoo($extraArgument)
{
return $extraArgument;
}
protected function getBar($extraArgument)
{
return $extraArgument;
}
private function getBaz($extraArgument)
{
return $extraArgument;
}
}
echo "OK\n";
--EXPECT--
OK
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #72508 (strange references after recursive function call and "switch" statement)
--FILE--
<?php
function a ($option) {
b($option['bla']);
c($option);
var_dump($option);
}
function b (&$string) {
$string = 'changed';
}
function c ($option) {
switch ($option['bla']) {
default:
$copy = $option;
$copy['bla'] = 'copy';
break;
}
}
a(array('bla' => 'fasel'));
?>
--EXPECT--
array(1) {
["bla"]=>
string(7) "changed"
}
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72581 (previous property undefined in Exception after deserialization)
--FILE--
<?php
$e = new Exception('aaa', 200);
$a = serialize($e);
$b = unserialize($a);
var_dump($b->__toString());
?>
--EXPECTF--
string(%s) "Exception: aaa in %sbug72581.php:%d
Stack trace:
#0 {main}"
+33
View File
@@ -0,0 +1,33 @@
--TEST--
Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
--INI--
opcache.enable=0
--FILE--
<?php
if (isset($runtime)) {
return new class {
public $bar;
public function bing($foo = null) {
if ($foo) $foo->bing();
}
};
}
$runtime = 1;
$oldFoo = require(__FILE__);
$newFoo = require(__FILE__);
var_dump(get_class_methods($oldFoo));
var_dump(get_object_vars($oldFoo));
$newFoo->bing($oldFoo);
?>
--EXPECTF--
array(1) {
[0]=>
string(4) "bing"
}
array(1) {
["bar"]=>
NULL
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72767: PHP Segfaults when trying to expand an infinite operator
--FILE--
<?php
function test() {}
$iterator = new LimitIterator(
new InfiniteIterator(new ArrayIterator([42])),
0, 17000
);
test(...$iterator);
?>
===DONE===
--EXPECT--
===DONE===
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #72813 (Segfault with __get returned by ref)
--FILE--
<?php
class Test
{
private $props = ['a' => 'text', 'b' => 1];
public function &__get($prop)
{
return $this->props[$prop];
}
public function __set($prop, $value)
{
if ($prop === 'b') $value = [$value];
$this->props[$prop] = $value;
}
public function getProperties()
{
return [$this->props];
}
}
$obj = new Test;
$obj->b = $obj->b;
print_r($obj->getProperties());
?>
--EXPECT--
Array
(
[0] => Array
(
[a] => text
[b] => Array
(
[0] => 1
)
)
)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #72854: PHP Crashes on duplicate destructor call
--FILE--
<?php
function get() {
$t = new stdClass;
$t->prop = $t;
return $t;
}
$i = 42;
get()->prop =& $i;
?>
===DONE===
--EXPECT--
===DONE===
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
--FILE--
<?php
$a = 0;
$b = $a->b->i -= 0;
var_dump($b);
?>
--EXPECTF--
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
NULL
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #72943 (assign_dim on string doesn't reset hval)
--FILE--
<?php
$array = array("test" => 1);
$a = "lest";
var_dump($array[$a]);
$a[0] = "f";
var_dump($array[$a]);
$a[0] = "t";
var_dump($array[$a]);
?>
--EXPECTF--
Notice: Undefined index: lest in %sbug72943.php on line %d
NULL
Notice: Undefined index: fest in %sbug72943.php on line %d
NULL
int(1)
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #72944 (Null pointer deref in zval_delref_p).
--FILE--
<?php
"a"== e & $A = $A? 0 : 0 ?:0;
echo "OK\n";
?>
--EXPECTF--
Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
Notice: Undefined variable: A in %sbug72944.php on line 2
OK
+50
View File
@@ -0,0 +1,50 @@
--TEST--
Bug #73156 (segfault on undefined function)
--FILE--
<?php
class A {
public function __call($name, $args) {
eval('$args = array(); var_dump(debug_backtrace());');
}
}
$a = new A();
$a->test("test");
?>
--EXPECTF--
array(2) {
[0]=>
array(3) {
["file"]=>
string(%d) "%sbug73156.php"
["line"]=>
int(4)
["function"]=>
string(4) "eval"
}
[1]=>
array(7) {
["file"]=>
string(%d) "%sbug73156.php"
["line"]=>
int(10)
["function"]=>
string(6) "__call"
["class"]=>
string(1) "A"
["object"]=>
object(A)#%d (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(4) "test"
[1]=>
array(0) {
}
}
}
}
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #73163 (PHP hangs if error handler throws while accessing undef const in default value)
--FILE--
<?php
function doSomething(string $value = UNDEFINED) {
}
set_error_handler(function($errno, $errstr) {
throw new Exception($errstr);
});
doSomething();
?>
--EXPECTF--
Fatal error: Uncaught Exception: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s:%d
Stack trace:
#0 %s(%d): {closure}(%s)
#1 %s(%d): doSomething()
#2 {main}
thrown in %s on line %d
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #73181: parse_str() without a second argument leads to crash
--FILE--
<?php
function x() {
parse_str("1&x");
var_dump(get_defined_vars());
}
x();
?>
--EXPECT--
array(2) {
[1]=>
string(0) ""
["x"]=>
string(0) ""
}
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #73337 (try/catch not working with two exceptions inside a same operation)
--FILE--
<?php
class d { function __destruct() { throw new Exception; } }
try { new d + new d; } catch (Exception $e) { print "Exception properly caught\n"; }
?>
--EXPECTF--
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
Exception properly caught
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #73338: Ensure exceptions in function init opcodes are cleaned properly
--FILE--
<?php
try { call_user_func(new class { function __destruct () { throw new Error; } }); } catch (Error $e) {}
set_error_handler(function() { throw new Error; });
try { var_dump(new stdClass, call_user_func("fail")); } catch (Error $e) {}
try { (function() { call_user_func("fail"); })(); } catch (Error $e) {}
try { [new class { static function foo() {} function __destruct () { throw new Error; } }, "foo"](); } catch (Error $e) {}
?>
--EXPECTF--
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in %s on line %d
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #73350 (Exception::__toString() cause circular references)
--FILE--
<?php
$e = new Exception();
// This line cause problem :(
// Comment it to see the difference.
(string) $e;
// This line show the clue (PHP Warning: ...).
var_export($e);
?>
--EXPECTF--
Exception::__set_state(array(
'message' => '',
'string' => 'Exception in %sbug73350.php:%d
Stack trace:
#0 {main}',
'code' => 0,
'file' => '%sbug73350.php',
'line' => %d,
'trace' =>
array (
),
'previous' => NULL,
))
+18
View File
@@ -0,0 +1,18 @@
--TEST--
call_user_func() should not use FUNC_ARG fetches
--FILE--
<?php
function foo(&$ref) { $ref = 24; }
$a = [];
call_user_func('foo', $a[0][0]);
var_dump($a);
?>
--EXPECTF--
Notice: Undefined offset: 0 in %s on line %d
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d
array(0) {
}
@@ -0,0 +1,15 @@
--TEST--
Constexpr arrays should be able to handle resource keys
--FILE--
<?php
const FOO = [STDIN => 42];
var_dump(FOO);
?>
--EXPECTF--
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
array(1) {
[%d]=>
int(42)
}
@@ -1,5 +1,7 @@
--TEST--
Testing __debugInfo() magic method with bad returns RESOURCE
--INI--
allow_url_fopen=1
--FILE--
<?php
@@ -40,11 +40,10 @@ Stack trace:
#2 %s(%d): Generator->next()
#3 {main}
Generator 1
Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Caught exception!
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Stack trace:
#0 [internal function]: gen(Object(Generator))
#1 %s(%d): Generator->current()
#2 {main}
thrown in %s on line %d
NULL
@@ -0,0 +1,37 @@
--TEST--
Cannot "yield from" from force closed generator
--FILE--
<?php
function gen1() {
echo "gen1\n";
yield 1;
}
function gen2() {
try {
echo "try\n";
yield from gen1();
} finally {
echo "finally\n";
yield from gen1();
}
}
try {
$gen = gen2();
$gen->rewind();
unset($gen);
} catch (Error $e) {
echo $e, "\n";
}
?>
--EXPECTF--
try
gen1
finally
Error: Cannot use "yield from" in a force-closed generator in %s:%d
Stack trace:
#0 %s(%d): gen2()
#1 {main}
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #69579 (Internal trait double-free)
--SKIPIF--
<?php
if (!PHP_DEBUG) die("skip only run in debug version");
?>
--FILE--
<?php
class Bar{
use _ZendTestTrait;
}
$bar = new Bar();
var_dump($bar->testMethod());
// destruction causes a double-free and explodes
?>
--EXPECT--
bool(true)
@@ -12,8 +12,8 @@ final class e { }
var_dump(get_declared_traits());
?>
--EXPECT--
array(1) {
[0]=>
--EXPECTF--
array(%d) {%A
[%d]=>
string(1) "c"
}
@@ -13,8 +13,8 @@ namespace test {
}
?>
--EXPECT--
array(1) {
[0]=>
--EXPECTF--
array(%d) {%A
[%d]=>
string(6) "test\c"
}
@@ -13,13 +13,15 @@ var_dump(get_declared_traits());
?>
--EXPECTF--
%astring(1) "a"
array(%d) {%A
[%d]=>
string(1) "a"
[%d]=>
string(1) "d"
[%d]=>
string(1) "e"
}
array(1) {
[0]=>
array(%d) {%A
[%d]=>
string(1) "c"
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72629 (Caught exception assignment to variables ignores references)
--FILE--
<?php
$var = null;
$e = &$var;
try {
throw new Exception;
} catch (Exception $e) { }
var_dump($var === $e);
--EXPECT--
bool(true)
@@ -0,0 +1,15 @@
--TEST--
"use function" should not conflict with class names
--FILE--
<?php
namespace Foo;
class Bar {}
use function bar;
?>
===DONE===
--EXPECT--
===DONE===
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Use conflicts should not occur across files
--FILE--
<?php
require __DIR__ . '/use_no_file_conflict_1.inc';
require __DIR__ . '/use_no_file_conflict_2.inc';
?>
===DONE===
--EXPECT--
===DONE===
+4
View File
@@ -0,0 +1,4 @@
<?php
namespace Foo;
class A {}
+4
View File
@@ -0,0 +1,4 @@
<?php
namespace Foo;
use A;
+13 -3
View File
@@ -678,9 +678,19 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
#if HAVE_DTRACE
/* build with dtrace support */
zend_compile_file = dtrace_compile_file;
zend_execute_ex = dtrace_execute_ex;
zend_execute_internal = dtrace_execute_internal;
{
char *tmp = getenv("USE_ZEND_DTRACE");
if (tmp && zend_atoi(tmp, 0)) {
zend_compile_file = dtrace_compile_file;
zend_execute_ex = dtrace_execute_ex;
zend_execute_internal = dtrace_execute_internal;
} else {
zend_compile_file = compile_file;
zend_execute_ex = execute_ex;
zend_execute_internal = NULL;
}
}
#else
zend_compile_file = compile_file;
zend_execute_ex = execute_ex;
+21 -5
View File
@@ -197,7 +197,6 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
}
/* }}} */
#ifdef FAST_ZPP
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
{
zend_function *active_function = EG(current_execute_data)->func;
@@ -291,7 +290,6 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
return 1;
}
/* }}} */
#endif
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
{
@@ -1861,7 +1859,7 @@ static int zend_startup_module_zval(zval *zv) /* {{{ */
{
zend_module_entry *module = Z_PTR_P(zv);
return zend_startup_module_ex(module);
return (zend_startup_module_ex(module) == SUCCESS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
}
/* }}} */
@@ -3100,13 +3098,13 @@ get_function_via_handler:
if (retval) {
if (fcc->calling_scope && !call_via_handler) {
if (!fcc->object && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) {
if (error) {
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
retval = 0;
} else {
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
return 0;
retval = 0;
}
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
int severity;
@@ -3849,6 +3847,24 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
}
/* }}} */
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
{
zval property;
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->unset_property) {
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
}
ZVAL_STRINGL(&property, name, name_length);
Z_OBJ_HT_P(object)->unset_property(object, &property, 0);
zval_ptr_dtor(&property);
EG(scope) = old_scope;
}
/* }}} */
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval tmp;
+3 -6
View File
@@ -343,6 +343,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value);
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value);
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);
ZEND_API int zend_update_static_property_null(zend_class_entry *scope, const char *name, size_t name_length);
@@ -665,13 +666,11 @@ END_EXTERN_C()
/* Fast parameter parsing API */
/* This API should be used only for really often used functions.
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
/* Fast ZPP is always enabled now; this define is left in for compatibility
* with any existing conditional compilation blocks.
*/
#define FAST_ZPP 1
#ifdef FAST_ZPP
#define Z_EXPECTED_TYPES(_) \
_(Z_EXPECTED_LONG, "integer") \
_(Z_EXPECTED_BOOL, "boolean") \
@@ -1034,8 +1033,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
#endif /* FAST_ZPP */
/* End of new parameter parsing API */
/* Inlined implementations shared by new and old parameter parsing APIs */
+31 -33
View File
@@ -897,6 +897,7 @@ static void *zend_mm_alloc_pages(zend_mm_heap *heap, int pages_count ZEND_FILE_L
{
zend_mm_chunk *chunk = heap->main_chunk;
int page_num, len;
int steps = 0;
while (1) {
if (UNEXPECTED(chunk->free_pages < pages_count)) {
@@ -1073,10 +1074,20 @@ get_chunk:
goto found;
} else {
chunk = chunk->next;
steps++;
}
}
found:
if (steps > 2 && pages_count < 8) {
/* move chunk into the head of the linked-list */
chunk->prev->next = chunk->next;
chunk->next->prev = chunk->prev;
chunk->next = heap->main_chunk->next;
chunk->prev = heap->main_chunk;
chunk->prev->next = chunk;
chunk->next->prev = chunk;
}
/* mark run as allocated */
chunk->free_pages -= pages_count;
zend_mm_bitset_set_range(chunk->free_map, page_num, pages_count);
@@ -1472,7 +1483,7 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
#endif
#ifdef ZEND_WIN32
/* On Windows we don't have ability to extend huge blocks in-place.
* We allocate them with 2MB size granularity, to avoid many
* We allocate them with 2MB size granularity, to avoid many
* reallocations when they are extended by small pieces
*/
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
@@ -1548,21 +1559,21 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
if (info & ZEND_MM_IS_SRUN) {
int old_bin_num, bin_num;
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
int old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
old_size = bin_data_size[old_bin_num];
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
if (size <= ZEND_MM_MAX_SMALL_SIZE) {
int bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
#if ZEND_DEBUG
dbg = zend_mm_get_debug_info(heap, ptr);
dbg->size = real_size;
dbg->filename = __zend_filename;
dbg->orig_filename = __zend_orig_filename;
dbg->lineno = __zend_lineno;
dbg->orig_lineno = __zend_orig_lineno;
dbg = zend_mm_get_debug_info(heap, ptr);
dbg->size = real_size;
dbg->filename = __zend_filename;
dbg->orig_filename = __zend_orig_filename;
dbg->lineno = __zend_lineno;
dbg->orig_lineno = __zend_orig_lineno;
#endif
return ptr;
return ptr;
}
}
} else /* if (info & ZEND_MM_IS_LARGE_RUN) */ {
ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE) == 0, "zend_mm_heap corrupted");
@@ -1740,7 +1751,7 @@ static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_D
{
#ifdef ZEND_WIN32
/* On Windows we don't have ability to extend huge blocks in-place.
* We allocate them with 2MB size granularity, to avoid many
* We allocate them with 2MB size granularity, to avoid many
* reallocations when they are extended by small pieces
*/
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
@@ -2500,37 +2511,24 @@ ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size(void *ptr ZEND_FILE_LINE_DC Z
return zend_mm_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
static zend_always_inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
int overflow;
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
if (UNEXPECTED(overflow)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
return 0;
}
return ret;
}
ZEND_API void* ZEND_FASTCALL _safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
return emalloc_rel(safe_address(nmemb, size, offset));
return emalloc_rel(zend_safe_address_guarded(nmemb, size, offset));
}
ZEND_API void* ZEND_FASTCALL _safe_malloc(size_t nmemb, size_t size, size_t offset)
{
return pemalloc(safe_address(nmemb, size, offset), 1);
return pemalloc(zend_safe_address_guarded(nmemb, size, offset), 1);
}
ZEND_API void* ZEND_FASTCALL _safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
return erealloc_rel(ptr, safe_address(nmemb, size, offset));
return erealloc_rel(ptr, zend_safe_address_guarded(nmemb, size, offset));
}
ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset)
{
return perealloc(ptr, safe_address(nmemb, size, offset), 1);
return perealloc(ptr, zend_safe_address_guarded(nmemb, size, offset), 1);
}
@@ -2646,9 +2644,9 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
alloc_globals->mm_heap = malloc(sizeof(zend_mm_heap));
memset(alloc_globals->mm_heap, 0, sizeof(zend_mm_heap));
alloc_globals->mm_heap->use_custom_heap = ZEND_MM_CUSTOM_HEAP_STD;
alloc_globals->mm_heap->custom_heap.std._malloc = malloc;
alloc_globals->mm_heap->custom_heap.std._malloc = __zend_malloc;
alloc_globals->mm_heap->custom_heap.std._free = free;
alloc_globals->mm_heap->custom_heap.std._realloc = realloc;
alloc_globals->mm_heap->custom_heap.std._realloc = __zend_realloc;
return;
}
#endif
+14 -2
View File
@@ -181,7 +181,11 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
{
switch (Z_TYPE_P(offset)) {
case IS_UNDEF:
zend_hash_next_index_insert(Z_ARRVAL_P(result), expr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), expr)) {
zend_error(E_WARNING,
"Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr);
}
break;
case IS_STRING:
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(offset), expr);
@@ -202,6 +206,10 @@ static int zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
case IS_DOUBLE:
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), expr);
break;
case IS_RESOURCE:
zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_HANDLE_P(offset), Z_RES_HANDLE_P(offset));
zend_hash_index_update(Z_ARRVAL_P(result), Z_RES_HANDLE_P(offset), expr);
break;
default:
zend_throw_error(NULL, "Illegal offset type");
return FAILURE;
@@ -1217,7 +1225,11 @@ simple_list:
if (ast->child[0]->kind == ZEND_AST_ENCAPS_LIST) {
zend_ast_export_encaps_list(str, '`', (zend_ast_list*)ast->child[0], indent);
} else {
zend_ast_export_ex(str, ast->child[0], 0, indent);
zval *zv;
ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_ZVAL);
zv = zend_ast_get_zval(ast->child[0]);
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
zend_ast_export_qstr(str, '`', Z_STR_P(zv));
}
smart_str_appendc(str, '`');
break;
+63 -72
View File
@@ -31,6 +31,10 @@
#undef ZEND_TEST_EXCEPTIONS
#if ZEND_DEBUG
static zend_class_entry *zend_test_trait;
#endif
static ZEND_FUNCTION(zend_version);
static ZEND_FUNCTION(func_num_args);
static ZEND_FUNCTION(func_get_arg);
@@ -257,6 +261,18 @@ ZEND_END_ARG_INFO()
/* }}} */
#if ZEND_DEBUG
static ZEND_METHOD(_ZendTestTrait, testMethod) /* {{{ */ {
RETURN_TRUE;
}
/* }}} */
static zend_function_entry zend_test_trait_methods[] = {
ZEND_ME(_ZendTestTrait, testMethod, arginfo_zend__void, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
#endif
static const zend_function_entry builtin_functions[] = { /* {{{ */
ZEND_FE(zend_version, arginfo_zend__void)
ZEND_FE(func_num_args, arginfo_zend__void)
@@ -339,6 +355,13 @@ ZEND_MINIT_FUNCTION(core) { /* {{{ */
zend_register_default_classes();
#if ZEND_DEBUG
INIT_CLASS_ENTRY(class_entry, "_ZendTestTrait", zend_test_trait_methods);
zend_test_trait = zend_register_internal_class(&class_entry);
zend_test_trait->ce_flags |= ZEND_ACC_TRAIT;
zend_declare_property_null(zend_test_trait, "testProp", sizeof("testProp")-1, ZEND_ACC_PUBLIC);
#endif
return SUCCESS;
}
/* }}} */
@@ -544,15 +567,9 @@ ZEND_FUNCTION(strlen)
{
zend_string *s;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(s)
ZEND_PARSE_PARAMETERS_END();
#endif
RETVAL_LONG(ZSTR_LEN(s));
}
@@ -692,16 +709,10 @@ ZEND_FUNCTION(error_reporting)
zval *err;
int old_error_reporting;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL(err)
ZEND_PARSE_PARAMETERS_END();
#endif
old_error_reporting = EG(error_reporting);
if (ZEND_NUM_ARGS() != 0) {
@@ -815,18 +826,12 @@ ZEND_FUNCTION(define)
int case_sensitive = CONST_CS;
zend_constant c;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(name)
Z_PARAM_ZVAL(val)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(non_cs)
ZEND_PARSE_PARAMETERS_END();
#endif
if (non_cs) {
case_sensitive = 0;
@@ -907,15 +912,9 @@ ZEND_FUNCTION(defined)
{
zend_string *name;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (zend_get_constant_ex(name, NULL, ZEND_FETCH_CLASS_SILENT)) {
RETURN_TRUE;
@@ -1011,18 +1010,12 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
zend_bool allow_string = only_subclass;
zend_bool retval;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(obj)
Z_PARAM_STR(class_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(allow_string)
ZEND_PARSE_PARAMETERS_END();
#endif
/*
* allow_string - is_a default is no, is_subclass_of is yes.
* if it's allowed, then the autoloader will be called if the class does not exist.
@@ -1162,15 +1155,9 @@ ZEND_FUNCTION(get_object_vars)
zend_string *key;
zend_object *zobj;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJECT(obj)
ZEND_PARSE_PARAMETERS_END();
#endif
if (Z_OBJ_HT_P(obj)->get_properties == NULL) {
RETURN_FALSE;
@@ -1306,16 +1293,11 @@ ZEND_FUNCTION(method_exists)
zend_string *lcname;
zend_class_entry * ce;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_ZVAL(klass)
Z_PARAM_STR(method_name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
@@ -1411,17 +1393,11 @@ ZEND_FUNCTION(class_exists)
zend_class_entry *ce;
zend_bool autoload = 1;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(class_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif
if (!autoload) {
if (ZSTR_VAL(class_name)[0] == '\\') {
@@ -1454,17 +1430,11 @@ ZEND_FUNCTION(interface_exists)
zend_class_entry *ce;
zend_bool autoload = 1;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(iface_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif
if (!autoload) {
if (ZSTR_VAL(iface_name)[0] == '\\') {
@@ -1496,17 +1466,11 @@ ZEND_FUNCTION(trait_exists)
zend_class_entry *ce;
zend_bool autoload = 1;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(trait_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif
if (!autoload) {
if (ZSTR_VAL(trait_name)[0] == '\\') {
@@ -1539,15 +1503,9 @@ ZEND_FUNCTION(function_exists)
zend_function *func;
zend_string *lcname;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (ZSTR_VAL(name)[0] == '\\') {
/* Ignore leading "\" */
@@ -2253,9 +2211,33 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
zend_hash_real_init(Z_ARRVAL_P(arg_array), 1);
ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(arg_array)) {
if (call->func->type == ZEND_USER_FUNCTION) {
uint32_t first_extra_arg = call->func->op_array.num_args;
uint32_t first_extra_arg = MIN(num_args, call->func->op_array.num_args);
if (ZEND_CALL_NUM_ARGS(call) > first_extra_arg) {
if (UNEXPECTED(call->symbol_table)) {
/* In case of attached symbol_table, values on stack may be invalid
* and we have to access them through symbol_table
* See: https://bugs.php.net/bug.php?id=73156
*/
zend_string *arg_name;
zval *arg;
while (i < first_extra_arg) {
arg_name = call->func->op_array.vars[i];
arg = zend_hash_find_ind(call->symbol_table, arg_name);
if (arg) {
if (Z_OPT_REFCOUNTED_P(arg)) {
Z_ADDREF_P(arg);
}
n++;
ZEND_HASH_FILL_ADD(arg);
} else {
zval tmp;
ZVAL_UNDEF(&tmp);
ZEND_HASH_FILL_ADD(&tmp);
}
i++;
}
} else {
while (i < first_extra_arg) {
if (EXPECTED(Z_TYPE_INFO_P(p) != IS_UNDEF)) {
if (Z_OPT_REFCOUNTED_P(p)) {
@@ -2267,8 +2249,8 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array) /
p++;
i++;
}
p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
}
p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
}
while (i < num_args) {
@@ -2388,8 +2370,10 @@ ZEND_FUNCTION(debug_print_backtrace)
if (object) {
if (func->common.scope) {
class_name = func->common.scope->name;
} else {
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
class_name = object->ce->name;
} else {
class_name = object->handlers->get_class_name(object);
}
call_type = "->";
@@ -2449,6 +2433,11 @@ ZEND_FUNCTION(debug_print_backtrace)
if (class_name) {
ZEND_PUTS(ZSTR_VAL(class_name));
ZEND_PUTS(call_type);
if (object
&& !func->common.scope
&& object->handlers->get_class_name != std_object_handlers.get_class_name) {
zend_string_release(class_name);
}
}
zend_printf("%s(", function_name);
if (Z_TYPE(arg_array) != IS_UNDEF) {
@@ -2608,9 +2597,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
if (object) {
if (func->common.scope) {
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(func->common.scope->name));
} else {
} else if (object->handlers->get_class_name == std_object_handlers.get_class_name) {
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, zend_string_copy(object->ce->name));
} else {
zend_string *class_name = object->handlers->get_class_name(object);
add_assoc_str_ex(&stack_frame, "class", sizeof("class")-1, class_name);
}
if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) {
zval zv;
+105 -53
View File
@@ -1944,10 +1944,42 @@ static inline uint32_t zend_emit_jump(uint32_t opnum_target) /* {{{ */
}
/* }}} */
ZEND_API int zend_is_smart_branch(zend_op *opline) /* {{{ */
{
switch (opline->opcode) {
case ZEND_IS_IDENTICAL:
case ZEND_IS_NOT_IDENTICAL:
case ZEND_IS_EQUAL:
case ZEND_IS_NOT_EQUAL:
case ZEND_IS_SMALLER:
case ZEND_IS_SMALLER_OR_EQUAL:
case ZEND_CASE:
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
case ZEND_INSTANCEOF:
case ZEND_TYPE_CHECK:
case ZEND_DEFINED:
return 1;
default:
return 0;
}
}
/* }}} */
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
{
uint32_t opnum = get_next_op_number(CG(active_op_array));
zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL);
zend_op *opline;
if ((cond->op_type & (IS_CV|IS_CONST))
&& opnum > 0
&& zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) {
/* emit extra NOP to avoid incorrect SMART_BRANCH in very rare cases */
zend_emit_op(NULL, ZEND_NOP, NULL, NULL);
opnum = get_next_op_number(CG(active_op_array));
}
opline = zend_emit_op(NULL, opcode, cond, NULL);
opline->op2.opline_num = opnum_target;
return opnum;
}
@@ -3070,19 +3102,9 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
zend_ast *arg_ast = args->child[i];
znode arg_node;
zend_op *opline;
zend_bool send_user = 0;
if (zend_is_variable(arg_ast) && !zend_is_call(arg_ast)) {
zend_compile_var(&arg_node, arg_ast, BP_VAR_FUNC_ARG | (i << BP_VAR_SHIFT));
send_user = 1;
} else {
zend_compile_expr(&arg_node, arg_ast);
if (arg_node.op_type & (IS_VAR|IS_CV)) {
send_user = 1;
}
}
if (send_user) {
zend_compile_expr(&arg_node, arg_ast);
if (arg_node.op_type & (IS_VAR|IS_CV)) {
opline = zend_emit_op(NULL, ZEND_SEND_USER, &arg_node, NULL);
} else {
opline = zend_emit_op(NULL, ZEND_SEND_VAL, &arg_node, NULL);
@@ -4035,16 +4057,32 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
znode expr_node, case_node;
zend_op *opline;
uint32_t *jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
uint32_t opnum_default_jmp;
uint32_t *jmpnz_opnums, opnum_default_jmp;
zend_compile_expr(&expr_node, expr_ast);
if (cases->children == 1 && cases->child[0]->child[0] == NULL) {
/* we have to take care about the case that only have one default branch,
* expr result will not be unrefed in this case, but it should be like in ZEND_CASE */
zend_ast *stmt_ast = cases->child[0]->child[1];
if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
} else if (expr_node.op_type == IS_CONST) {
zval_dtor(&expr_node.u.constant);
}
zend_begin_loop(ZEND_NOP, NULL);
zend_compile_stmt(stmt_ast);
zend_end_loop(get_next_op_number(CG(active_op_array)));
return;
}
zend_begin_loop(ZEND_FREE, &expr_node);
case_node.op_type = IS_TMP_VAR;
case_node.u.op.var = get_temporary_variable(CG(active_op_array));
jmpnz_opnums = safe_emalloc(sizeof(uint32_t), cases->children, 0);
for (i = 0; i < cases->children; ++i) {
zend_ast *case_ast = cases->child[i];
zend_ast *cond_ast = case_ast->child[0];
@@ -5277,7 +5315,7 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
opline = get_next_op(CG(active_op_array));
zend_make_var_result(&declare_node, opline);
// TODO.AST drop this
/* TODO.AST drop this */
GET_NODE(&FC(implementing_class), opline->result);
opline->op2_type = IS_CONST;
@@ -5293,7 +5331,15 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
opline->op1_type = IS_UNUSED;
zend_hash_update_ptr(CG(class_table), lcname, ce);
if (!zend_hash_exists(CG(class_table), lcname)) {
zend_hash_add_ptr(CG(class_table), lcname, ce);
} else {
/* this anonymous class has been included */
zval zv;
ZVAL_PTR(&zv, ce);
destroy_zend_class(&zv);
return;
}
} else {
zend_string *key;
@@ -5453,6 +5499,41 @@ static void zend_check_already_in_use(uint32_t type, zend_string *old_name, zend
}
/* }}} */
static void zend_check_use_conflict(
uint32_t type, zend_string *old_name, zend_string *new_name, zend_string *lookup_name) {
switch (type) {
case T_CLASS:
{
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name);
if (ce && ce->type == ZEND_USER_CLASS
&& ce->info.user.filename == CG(compiled_filename)
) {
zend_check_already_in_use(type, old_name, new_name, lookup_name);
}
break;
}
case T_FUNCTION:
{
zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name);
if (fn && fn->type == ZEND_USER_FUNCTION
&& fn->op_array.filename == CG(compiled_filename)
) {
zend_check_already_in_use(type, old_name, new_name, lookup_name);
}
break;
}
case T_CONST:
{
zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name);
if (filename && filename == CG(compiled_filename)) {
zend_check_already_in_use(type, old_name, new_name, lookup_name);
}
break;
}
EMPTY_SWITCH_DEFAULT_CASE()
}
}
void zend_compile_use(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
@@ -5509,43 +5590,11 @@ void zend_compile_use(zend_ast *ast) /* {{{ */
ZSTR_VAL(ns_name)[ZSTR_LEN(current_ns)] = '\\';
memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name));
if (zend_hash_exists(CG(class_table), ns_name)) {
zend_check_already_in_use(type, old_name, new_name, ns_name);
}
zend_check_use_conflict(type, old_name, new_name, ns_name);
zend_string_free(ns_name);
} else {
switch (type) {
case T_CLASS:
{
zend_class_entry *ce = zend_hash_find_ptr(CG(class_table), lookup_name);
if (ce && ce->type == ZEND_USER_CLASS
&& ce->info.user.filename == CG(compiled_filename)
) {
zend_check_already_in_use(type, old_name, new_name, lookup_name);
}
break;
}
case T_FUNCTION:
{
zend_function *fn = zend_hash_find_ptr(CG(function_table), lookup_name);
if (fn && fn->type == ZEND_USER_FUNCTION
&& fn->op_array.filename == CG(compiled_filename)
) {
zend_check_already_in_use(type, old_name, new_name, lookup_name);
}
break;
}
case T_CONST:
{
zend_string *filename = zend_hash_find_ptr(&CG(const_filenames), lookup_name);
if (filename && filename == CG(compiled_filename)) {
zend_check_already_in_use(type, old_name, new_name, lookup_name);
}
break;
}
EMPTY_SWITCH_DEFAULT_CASE()
}
zend_check_use_conflict(type, old_name, new_name, lookup_name);
}
zend_string_addref(old_name);
@@ -5580,7 +5629,6 @@ void zend_compile_group_use(zend_ast *ast) /* {{{ */
}
/* }}} */
void zend_compile_const_decl(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
@@ -5905,7 +5953,11 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
break;
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(result), value);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(result), value)) {
zval_ptr_dtor_nogc(value);
zval_ptr_dtor(result);
return 0;
}
}
}
+1
View File
@@ -761,6 +761,7 @@ ZEND_API char *zend_make_compiled_string_description(const char *name);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
uint32_t zend_get_class_fetch_type(zend_string *name);
ZEND_API zend_uchar zend_get_call_op(zend_uchar init_op, zend_function *fbc);
ZEND_API int zend_is_smart_branch(zend_op *opline);
typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
typedef struct _zend_auto_global {
+29 -9
View File
@@ -291,13 +291,9 @@ ZEND_METHOD(exception, __construct)
/* {{{ proto Exception::__wakeup()
Exception unserialize checks */
#define CHECK_EXC_TYPE(name, type) \
ZVAL_UNDEF(&value); \
pvalue = zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value); \
if(Z_TYPE_P(pvalue) != IS_UNDEF && Z_TYPE_P(pvalue) != type) { \
zval tmp; \
ZVAL_STRINGL(&tmp, name, sizeof(name) - 1); \
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
zval_ptr_dtor(&tmp); \
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
zend_unset_property(i_get_exception_base(object), object, name, sizeof(name)-1); \
}
ZEND_METHOD(exception, __wakeup)
@@ -310,7 +306,12 @@ ZEND_METHOD(exception, __wakeup)
CHECK_EXC_TYPE("file", IS_STRING);
CHECK_EXC_TYPE("line", IS_LONG);
CHECK_EXC_TYPE("trace", IS_ARRAY);
CHECK_EXC_TYPE("previous", IS_OBJECT);
pvalue = zend_read_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1, 1, &value);
if (pvalue && Z_TYPE_P(pvalue) != IS_NULL && (Z_TYPE_P(pvalue) != IS_OBJECT ||
!instanceof_function(Z_OBJCE_P(pvalue), i_get_exception_base(object)) ||
pvalue == object)) {
zend_unset_property(i_get_exception_base(object), object, "previous", sizeof("previous")-1);
}
}
/* }}} */
@@ -563,11 +564,14 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
case IS_ARRAY:
smart_str_appends(str, "Array, ");
break;
case IS_OBJECT:
case IS_OBJECT: {
zend_string *class_name = Z_OBJ_HANDLER_P(arg, get_class_name)(Z_OBJ_P(arg));
smart_str_appends(str, "Object(");
smart_str_appends(str, ZSTR_VAL(Z_OBJCE_P(arg)->name));
smart_str_appends(str, ZSTR_VAL(class_name));
smart_str_appends(str, "), ");
zend_string_release(class_name);
break;
}
}
}
/* }}} */
@@ -769,10 +773,25 @@ ZEND_METHOD(exception, __toString)
zend_string_release(file);
zval_ptr_dtor(&trace);
Z_OBJPROP_P(exception)->u.v.nApplyCount++;
exception = GET_PROPERTY(exception, "previous");
if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) {
break;
}
}
zval_dtor(&fname);
exception = getThis();
/* Reset apply counts */
while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) {
if (Z_OBJPROP_P(exception)->u.v.nApplyCount) {
Z_OBJPROP_P(exception)->u.v.nApplyCount--;
} else {
break;
}
exception = GET_PROPERTY(exception, "previous");
}
exception = getThis();
base_ce = i_get_exception_base(exception);
@@ -1069,6 +1088,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
zend_throw_error(NULL, "Cannot throw objects that do not implement Throwable");
zval_ptr_dtor(exception);
return;
}
zend_throw_exception_internal(exception);
+26 -12
View File
@@ -145,7 +145,8 @@ static const zend_internal_function zend_pass_function = {
((ZEND_VM_STACK_PAGE_SLOTS(gen) - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval))
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(gen, size) \
(((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
+ (ZEND_VM_STACK_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
zend_vm_stack page = (zend_vm_stack)emalloc(size);
@@ -584,7 +585,17 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
ref = Z_REF_P(value_ptr);
GC_REFCOUNT(ref)++;
zval_ptr_dtor(variable_ptr);
if (Z_REFCOUNTED_P(variable_ptr)) {
zend_refcounted *garbage = Z_COUNTED_P(variable_ptr);
if (--GC_REFCOUNT(garbage) == 0) {
ZVAL_REF(variable_ptr, ref);
zval_dtor_func_for_ptr(garbage);
return;
} else {
GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr);
}
}
ZVAL_REF(variable_ptr, ref);
}
@@ -592,7 +603,9 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
static inline int make_real_object(zval *object)
{
if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)) {
if (UNEXPECTED(object == &EG(error_zval))) {
return 0;
} else if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)) {
/* nothing to destroy */
} else if (EXPECTED((Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zval_ptr_dtor_nogc(object);
@@ -822,11 +835,8 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
} else {
ce = zend_verify_arg_class_kind(cur_arg_info);
if (UNEXPECTED(!ce)) {
if (Z_TYPE_P(arg) == IS_OBJECT) {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name), arg);
} else {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
}
ZEND_ASSERT(Z_TYPE_P(arg) != IS_OBJECT);
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg), arg);
return 0;
}
*cache_slot = (void*)ce;
@@ -1333,6 +1343,7 @@ static void zend_assign_to_string_offset(zval *str, zend_long offset, zval *valu
zend_string_release(tmp);
} else {
Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0];
zend_string_forget_hash_val(Z_STR_P(str));
}
/*
* the value of an assignment to a string offset is undefined
@@ -1401,11 +1412,11 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
zval rv;
if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
zval *z, obj;
zval *z, *zptr, obj;
ZVAL_OBJ(&obj, Z_OBJ_P(object));
Z_ADDREF(obj);
z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
zptr = z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv);
if (UNEXPECTED(EG(exception))) {
OBJ_RELEASE(Z_OBJ(obj));
return;
@@ -1432,7 +1443,7 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object,
}
Z_OBJ_HT(obj)->write_property(&obj, property, z, cache_slot);
OBJ_RELEASE(Z_OBJ(obj));
zval_ptr_dtor(z);
zval_ptr_dtor(zptr);
} else {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (UNEXPECTED(result)) {
@@ -2444,9 +2455,12 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
if (UNEXPECTED(opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_DYNAMIC_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL)) {
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_NEW)) {
ZEND_ASSERT(op_num);
opline--;
}
+22 -29
View File
@@ -573,8 +573,6 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
ZVAL_EMPTY_STRING(p);
}
} else if (UNEXPECTED((const_value = zend_get_constant_ex(Z_STR_P(p), scope, Z_CONST_FLAGS_P(p))) == NULL)) {
char *actual = Z_STRVAL_P(p);
if (UNEXPECTED(EG(exception))) {
RESET_CONSTANT_VISITED(p);
return FAILURE;
@@ -584,46 +582,38 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
return FAILURE;
} else {
zend_string *save = Z_STR_P(p);
char *slash;
size_t actual_len = Z_STRLEN_P(p);
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
if (inline_change) {
zend_string *s = zend_string_init(actual, actual_len, 0);
Z_STR_P(p) = s;
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
}
}
if (actual[0] == '\\') {
if (inline_change) {
memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p));
--Z_STRLEN_P(p);
} else {
++actual;
}
--actual_len;
}
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
if (ZSTR_VAL(save)[0] == '\\') {
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save) + 1);
} else {
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save));
}
if (inline_change) {
zend_string_release(save);
}
RESET_CONSTANT_VISITED(p);
return FAILURE;
} else {
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
char *actual = Z_STRVAL_P(p);
size_t actual_len = Z_STRLEN_P(p);
char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
if (slash) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
}
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
if (EG(exception)) {
RESET_CONSTANT_VISITED(p);
return FAILURE;
}
if (!inline_change) {
ZVAL_STRINGL(p, actual, actual_len);
} else {
Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
IS_STRING_EX : IS_INTERNED_STRING_EX;
if (save && ZSTR_VAL(save) != actual) {
if (slash) {
ZVAL_STRINGL(p, actual, actual_len);
zend_string_release(save);
} else {
Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
IS_STRING_EX : IS_INTERNED_STRING_EX;
}
}
}
@@ -862,8 +852,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
EG(scope) = func->common.scope;
call->symbol_table = fci->symbol_table;
if (EXPECTED((func->op_array.fn_flags & ZEND_ACC_GENERATOR) == 0)) {
const zend_op *current_opline_before_exception = EG(opline_before_exception);
zend_init_execute_data(call, &func->op_array, fci->retval);
zend_execute_ex(call);
EG(opline_before_exception) = current_opline_before_exception;
} else {
zend_generator_create_zval(call, &func->op_array, fci->retval);
}
+1
View File
@@ -1097,6 +1097,7 @@ ZEND_API int zend_gc_collect_cycles(void)
if (EG(objects_store).object_buckets &&
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
GC_TYPE(obj) = IS_NULL;
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
+12 -13
View File
@@ -297,6 +297,8 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
{
zend_execute_data *original_execute_data = EG(current_execute_data);
/* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
zval_ptr_dtor(&generator->values);
@@ -305,7 +307,6 @@ static void zend_generator_throw_exception(zend_generator *generator, zval *exce
/* Throw the exception in the context of the generator. Decrementing the opline
* to pretend the exception happened during the YIELD opcode. */
zend_execute_data *original_execute_data = EG(current_execute_data);
EG(current_execute_data) = generator->execute_data;
generator->execute_data->opline--;
if (exception) {
@@ -521,6 +522,16 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
EG(current_execute_data) = original_execute_data;
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
leaf->node.ptr.root = root;
root->node.parent = NULL;
if (old_root) {
OBJ_RELEASE(&old_root->std);
}
zend_generator_resume(leaf);
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
}
} else {
zval_ptr_dtor(&root->value);
ZVAL_COPY(&root->value, &root->node.parent->value);
@@ -861,15 +872,9 @@ ZEND_METHOD(Generator, send)
zval *value;
zend_generator *generator, *root;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
#endif
generator = (zend_generator *) Z_OBJ_P(getThis());
@@ -905,15 +910,9 @@ ZEND_METHOD(Generator, throw)
zval *exception, exception_copy;
zend_generator *generator;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(exception)
ZEND_PARSE_PARAMETERS_END();
#endif
ZVAL_DUP(&exception_copy, exception);
+6 -3
View File
@@ -1447,13 +1447,17 @@ ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht)
} else if (ht->nNumUsed == ht->nNumOfElements) {
do {
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
zend_string_release(p->key);
if (EXPECTED(p->key)) {
zend_string_release(p->key);
}
} while (++p != end);
} else {
do {
if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) {
i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC);
zend_string_release(p->key);
if (EXPECTED(p->key)) {
zend_string_release(p->key);
}
}
} while (++p != end);
}
@@ -2465,7 +2469,6 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
register const char *tmp = key;
const char *end = key + length;
ZEND_ASSERT(*end == '\0');
if (*tmp == '-') {
tmp++;
+3 -2
View File
@@ -268,8 +268,8 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 1;
}
/* If both methods are private do not enforce a signature */
if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
/* If the prototype method is private do not enforce a signature */
if (proto->common.fn_flags & ZEND_ACC_PRIVATE) {
return 1;
}
@@ -1180,6 +1180,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
function_add_ref(fn);
new_fn = zend_arena_alloc(&CG(arena), sizeof(zend_op_array));
memcpy(new_fn, fn, sizeof(zend_op_array));
new_fn->common.fn_flags |= ZEND_ACC_ARENA_ALLOCATED;
fn = zend_hash_update_ptr(&ce->function_table, key, new_fn);
zend_add_magic_methods(ce, key, fn);
}
+20 -8
View File
@@ -46,6 +46,8 @@ int ini_parse(void);
#define YYFREE free
#endif
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
/* {{{ zend_ini_do_op()
*/
static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
@@ -86,7 +88,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
}
str_len = zend_sprintf(str_result, "%d", i_result);
ZVAL_PSTRINGL(result, str_result, str_len);
ZVAL_NEW_STR(result, zend_string_init(str_result, str_len, ZEND_SYSTEM_INI));
}
/* }}} */
@@ -94,7 +96,11 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
*/
static void zend_ini_init_string(zval *result)
{
ZVAL_EMPTY_PSTRING(result);
if (ZEND_SYSTEM_INI) {
ZVAL_EMPTY_PSTRING(result);
} else {
ZVAL_EMPTY_STRING(result);
}
}
/* }}} */
@@ -107,8 +113,12 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
if (Z_TYPE_P(op1) != IS_STRING) {
zend_string *str = zval_get_string(op1);
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
zend_string_release(str);
if (ZEND_SYSTEM_INI) {
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
zend_string_release(str);
} else {
ZVAL_STR(op1, str);
}
}
op1_len = (int)Z_STRLEN_P(op1);
@@ -117,7 +127,7 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
}
length = op1_len + (int)Z_STRLEN_P(op2);
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, 1));
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, ZEND_SYSTEM_INI));
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
}
/* }}} */
@@ -140,7 +150,7 @@ static void zend_ini_get_constant(zval *result, zval *name)
convert_to_string(&tmp);
c = &tmp;
}
ZVAL_PSTRINGL(result, Z_STRVAL_P(c), Z_STRLEN_P(c));
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(c), Z_STRLEN_P(c), ZEND_SYSTEM_INI));
if (c == &tmp) {
zend_string_release(Z_STR(tmp));
}
@@ -160,11 +170,11 @@ static void zend_ini_get_var(zval *result, zval *name)
/* Fetch configuration option value */
if ((curval = zend_get_configuration_directive(Z_STR_P(name))) != NULL) {
ZVAL_PSTRINGL(result, Z_STRVAL_P(curval), Z_STRLEN_P(curval));
ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(curval), Z_STRLEN_P(curval), ZEND_SYSTEM_INI));
/* ..or if not found, try ENV */
} else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name))) != NULL ||
(envvar = getenv(Z_STRVAL_P(name))) != NULL) {
ZVAL_PSTRING(result, envvar);
ZVAL_NEW_STR(result, zend_string_init(envvar, strlen(envvar), ZEND_SYSTEM_INI));
} else {
zend_ini_init_string(result);
}
@@ -282,6 +292,8 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
%left '|' '&' '^'
%right '~' '!'
%destructor { zval_ptr_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
%%
statement_list:
+2254 -2242
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -110,6 +110,8 @@ ZEND_API ts_rsrc_id ini_scanner_globals_id;
ZEND_API zend_ini_scanner_globals ini_scanner_globals;
#endif
#define ZEND_SYSTEM_INI CG(ini_parser_unbuffered_errors)
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
while (yyleng) { \
@@ -137,7 +139,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X')
#define zend_ini_copy_value(retval, str, len) \
ZVAL_NEW_STR(retval, zend_string_init(str, len, 1))
ZVAL_NEW_STR(retval, zend_string_init(str, len, ZEND_SYSTEM_INI))
#define RETURN_TOKEN(type, str, len) { \
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 */
/* Generated by re2c 0.14.3 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
+5310 -5142
View File
File diff suppressed because it is too large. Load diff
+6 -2
View File
@@ -589,6 +589,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
CG(ast) = NULL;
CG(ast_arena) = zend_arena_create(1024 * 32);
if (!zendparse()) {
int last_lineno = CG(zend_lineno);
zval retval_zv;
zend_file_context original_file_context;
zend_oparray_context original_oparray_context;
@@ -605,9 +606,10 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type)
zend_file_context_begin(&original_file_context);
zend_oparray_context_begin(&original_oparray_context);
zend_compile_top_stmt(CG(ast));
CG(zend_lineno) = last_lineno;
zend_emit_final_return(&retval_zv);
op_array->line_start = 1;
op_array->line_end = CG(zend_lineno);
op_array->line_end = last_lineno;
pass_two(op_array);
zend_oparray_context_end(&original_oparray_context);
zend_file_context_end(&original_file_context);
@@ -756,6 +758,7 @@ zend_op_array *compile_string(zval *source_string, char *filename)
BEGIN(ST_IN_SCRIPTING);
if (!zendparse()) {
int last_lineno = CG(zend_lineno);
zend_file_context original_file_context;
zend_oparray_context original_oparray_context;
zend_op_array *original_active_op_array = CG(active_op_array);
@@ -770,9 +773,10 @@ zend_op_array *compile_string(zval *source_string, char *filename)
zend_file_context_begin(&original_file_context);
zend_oparray_context_begin(&original_oparray_context);
zend_compile_top_stmt(CG(ast));
CG(zend_lineno) = last_lineno;
zend_emit_final_return(NULL);
op_array->line_start = 1;
op_array->line_end = CG(zend_lineno);
op_array->line_end = last_lineno;
pass_two(op_array);
zend_oparray_context_end(&original_oparray_context);
zend_file_context_end(&original_file_context);
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 */
/* Generated by re2c 0.16 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
+25
View File
@@ -266,6 +266,31 @@ static zend_always_inline size_t zend_safe_address(size_t nmemb, size_t size, si
}
#endif
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);
if (UNEXPECTED(overflow)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nmemb, size, offset);
return 0;
}
return ret;
}
/* A bit more generic version of the same */
static zend_always_inline size_t zend_safe_addmult(size_t nmemb, size_t size, size_t offset, const char *message)
{
int overflow;
size_t ret = zend_safe_address(nmemb, size, offset, &overflow);
if (UNEXPECTED(overflow)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in %s (%zu * %zu + %zu)", message, nmemb, size, offset);
return 0;
}
return ret;
}
#endif /* ZEND_MULTIPLY_H */
/*
+2 -10
View File
@@ -197,11 +197,7 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
it should return whether the call was successful or not
*/
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member);
zval_ptr_dtor(member);
}
/* }}} */
@@ -211,9 +207,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
int result;
zend_class_entry *ce = Z_OBJCE_P(object);
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
/* __set handler is called with two arguments:
property name
value to be set
@@ -222,9 +215,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
*/
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value);
zval_ptr_dtor(member);
zval_ptr_dtor(value);
if (Z_TYPE(retval) != IS_UNDEF) {
result = i_zend_is_true(&retval) ? SUCCESS : FAILURE;
zval_ptr_dtor(&retval);
@@ -746,9 +736,11 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
if (type == BP_VAR_IS) {
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
zval_ptr_dtor(offset);
return NULL;
}
if (!i_zend_is_true(rv)) {
zval_ptr_dtor(offset);
zval_ptr_dtor(rv);
return &EG(uninitialized_zval);
}
+3
View File
@@ -2927,6 +2927,9 @@ ZEND_API const char* ZEND_FASTCALL zend_memnstr_ex(const char *haystack, const c
if (i == needle_len) {
return p;
}
if (UNEXPECTED(p == end)) {
return NULL;
}
p += td[(unsigned char)(p[needle_len])];
}
+8 -2
View File
@@ -510,7 +510,10 @@ static zend_always_inline void fast_long_decrement_function(zval *op1)
static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2)
{
#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
#if defined(__GNUC__) && defined(__i386__) \
&& !(4 == __GNUC__ && 8 == __GNUC_MINOR__) \
&& !(4 == __GNUC__ && 9 == __GNUC_MINOR__ && (defined(__PIC__) || defined(__PIE__)))
/* Position-independent builds fail with gcc-4.9.x */
__asm__(
"movl (%1), %%eax\n\t"
"addl (%2), %%eax\n\t"
@@ -596,7 +599,10 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o
static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2)
{
#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__)
#if defined(__GNUC__) && defined(__i386__) && \
!(4 == __GNUC__ && 8 == __GNUC_MINOR__) && \
!(4 == __GNUC__ && 9 == __GNUC_MINOR__ && (defined(__PIC__) || defined(__PIE__)))
/* Position-independent builds fail with gcc-4.9.x */
__asm__(
"movl (%1), %%eax\n\t"
"subl (%2), %%eax\n\t"
+2
View File
@@ -125,6 +125,8 @@
# define ZEND_IGNORE_VALUE(x) ((void) (x))
#endif
#define zend_quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
/* all HAVE_XXX test have to be after the include of zend_config above */
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
+9 -1
View File
@@ -2677,6 +2677,14 @@ zend_strtod
}
}
dig_done:
if (nd < 0) {
/* overflow */
nd = DBL_DIG + 2;
}
if (nf < 0) {
/* overflow */
nf = DBL_DIG + 2;
}
e = 0;
if (c == 'e' || c == 'E') {
if (!nd && !nz && !nz0) {
@@ -4543,7 +4551,7 @@ static void destroy_freelist(void)
}
freelist[i] = NULL;
}
FREE_DTOA_LOCK(0)
FREE_DTOA_LOCK(0)
}
#ifdef __cplusplus
+6 -2
View File
@@ -64,8 +64,12 @@ typedef unsigned long int uint32_t;
# endif
#endif
#ifdef HAVE_LOCALE_H
#define USE_LOCALE 1
#ifdef USE_LOCALE
#undef USE_LOCALE
#endif
#ifndef NO_INFNAN_CHECK
#define NO_INFNAN_CHECK
#endif
#ifdef WORDS_BIGENDIAN
+10 -11
View File
@@ -30,17 +30,20 @@
ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
{
if (--GC_REFCOUNT(p)) {
return;
}
switch (GC_TYPE(p)) {
case IS_STRING:
case IS_CONSTANT: {
zend_string *str = (zend_string*)p;
CHECK_ZVAL_STRING_REL(str);
zend_string_release(str);
zend_string_free(str);
break;
}
case IS_ARRAY: {
zend_array *arr = (zend_array*)p;
ZEND_ASSERT(GC_REFCOUNT(arr) <= 1);
zend_array_destroy(arr);
break;
}
@@ -54,25 +57,21 @@ ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC
case IS_OBJECT: {
zend_object *obj = (zend_object*)p;
OBJ_RELEASE(obj);
zend_objects_store_del(obj);
break;
}
case IS_RESOURCE: {
zend_resource *res = (zend_resource*)p;
if (--GC_REFCOUNT(res) == 0) {
/* destroy resource */
zend_list_free(res);
}
/* destroy resource */
zend_list_free(res);
break;
}
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
if (--GC_REFCOUNT(ref) == 0) {
i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
efree_size(ref, sizeof(zend_reference));
}
i_zval_ptr_dtor(&ref->val ZEND_FILE_LINE_RELAY_CC);
efree_size(ref, sizeof(zend_reference));
break;
}
default:
+3 -2
View File
@@ -915,6 +915,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
if (pbuffer == NULL) {
CloseHandle(hLink);
return -1;
}
if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
@@ -1186,7 +1187,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int add_slash;
void *tmp;
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
#ifdef ZEND_WIN32
_set_errno(EINVAL);
#else
@@ -1853,7 +1854,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
#else /* Unix */
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
{
int command_length;
size_t command_length;
int dir_length, extra = 0;
char *command_line;
char *ptr, *dir;
+73 -24
View File
@@ -2312,6 +2312,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
FREE_UNFETCHED_OP1();
FREE_OP2_VAR_PTR();
HANDLE_EXCEPTION();
}
@@ -3011,15 +3012,19 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR
GC_REFCOUNT(obj)++; /* For $this pointer */
}
FREE_OP2();
FREE_OP1();
if ((OP1_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
FREE_OP2();
FREE_OP1();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSED|CV)
@@ -3160,7 +3165,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST)
@@ -3282,7 +3287,6 @@ ZEND_VM_C_LABEL(try_function_name):
called_scope = NULL;
object = NULL;
}
FREE_OP2();
} else if (OP2_TYPE != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
@@ -3296,7 +3300,6 @@ ZEND_VM_C_LABEL(try_function_name):
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
FREE_OP2();
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
zval *obj;
@@ -3380,7 +3383,6 @@ ZEND_VM_C_LABEL(try_function_name):
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
FREE_OP2();
} else if ((OP2_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
function_name = Z_REFVAL_P(function_name);
ZEND_VM_C_GOTO(try_function_name);
@@ -3395,6 +3397,18 @@ ZEND_VM_C_LABEL(try_function_name):
FREE_OP2();
HANDLE_EXCEPTION();
}
FREE_OP2();
if ((OP2_TYPE & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
zend_string_release(fbc->common.function_name);
zend_free_trampoline(fbc);
}
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, object);
call->prev_execute_data = EX(call);
@@ -3420,6 +3434,19 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
func = fcc.function_handler;
called_scope = fcc.called_scope;
object = fcc.object;
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
FREE_OP2();
HANDLE_EXCEPTION();
}
}
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
if (OP2_TYPE & (IS_VAR|IS_CV)) {
@@ -3429,25 +3456,28 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
object = fcc.object;
if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
FREE_OP2();
if ((OP2_TYPE & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_CLOSURE) {
zend_object_release((zend_object*)func->common.prototype);
}
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
HANDLE_EXCEPTION();
}
} else {
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
efree(error);
FREE_OP2();
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
func = (zend_function*)&zend_pass_function;
called_scope = NULL;
object = NULL;
@@ -3458,8 +3488,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV)
call->prev_execute_data = EX(call);
EX(call) = call;
FREE_OP2();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
@@ -4153,6 +4182,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
USE_OPLINE
zend_class_entry *ce, *catch_ce;
zend_object *exception;
zval *ex;
SAVE_OPLINE();
/* Check whether an exception has been thrown, if not, jump over code */
@@ -4187,8 +4217,12 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
}
exception = EG(exception);
zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
ex = EX_VAR(opline->op2.var);
if (UNEXPECTED(Z_ISREF_P(ex))) {
ex = Z_REFVAL_P(ex);
}
zval_ptr_dtor(ex);
ZVAL_OBJ(ex, EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
HANDLE_EXCEPTION();
@@ -4940,7 +4974,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, CONST|VAR, ANY)
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
}
@@ -5226,7 +5260,10 @@ ZEND_VM_C_LABEL(num_index):
}
FREE_OP2();
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -5449,6 +5486,10 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY)
}
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
if (new_op_array != NULL) {
destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
}
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
zval *return_value = NULL;
@@ -7442,6 +7483,12 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
val = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
FREE_OP1();
HANDLE_EXCEPTION();
}
if (Z_TYPE_P(val) == IS_ARRAY) {
ZVAL_COPY_VALUE(&generator->values, val);
if (OP1_TYPE != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
@@ -7463,12 +7510,14 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
zend_generator_yield_from(generator, new_gen);
}
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
+321 -102
View File
@@ -1995,7 +1995,6 @@ try_function_name:
called_scope = NULL;
object = NULL;
}
} else if (IS_CONST != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
@@ -2009,7 +2008,6 @@ try_function_name:
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
zval *obj;
@@ -2093,7 +2091,6 @@ try_function_name:
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
} else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
function_name = Z_REFVAL_P(function_name);
goto try_function_name;
@@ -2108,6 +2105,17 @@ try_function_name:
HANDLE_EXCEPTION();
}
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
zend_string_release(fbc->common.function_name);
zend_free_trampoline(fbc);
}
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, object);
call->prev_execute_data = EX(call);
@@ -2418,7 +2426,6 @@ try_function_name:
called_scope = NULL;
object = NULL;
}
} else if (IS_CV != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
@@ -2432,7 +2439,6 @@ try_function_name:
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
zval *obj;
@@ -2516,7 +2522,6 @@ try_function_name:
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
} else if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
function_name = Z_REFVAL_P(function_name);
goto try_function_name;
@@ -2531,6 +2536,17 @@ try_function_name:
HANDLE_EXCEPTION();
}
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
zend_string_release(fbc->common.function_name);
zend_free_trampoline(fbc);
}
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, object);
call->prev_execute_data = EX(call);
@@ -2674,7 +2690,6 @@ try_function_name:
called_scope = NULL;
object = NULL;
}
zval_ptr_dtor_nogc(free_op2);
} else if ((IS_TMP_VAR|IS_VAR) != IS_CONST &&
EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) &&
Z_OBJ_HANDLER_P(function_name, get_closure) &&
@@ -2688,7 +2703,6 @@ try_function_name:
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op2);
} else if (EXPECTED(Z_TYPE_P(function_name) == IS_ARRAY) &&
zend_hash_num_elements(Z_ARRVAL_P(function_name)) == 2) {
zval *obj;
@@ -2772,7 +2786,6 @@ try_function_name:
GC_REFCOUNT(object)++; /* For $this pointer */
}
}
zval_ptr_dtor_nogc(free_op2);
} else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_TYPE_P(function_name) == IS_REFERENCE) {
function_name = Z_REFVAL_P(function_name);
goto try_function_name;
@@ -2787,6 +2800,18 @@ try_function_name:
zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
zval_ptr_dtor_nogc(free_op2);
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
if (fbc->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
zend_string_release(fbc->common.function_name);
zend_free_trampoline(fbc);
}
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, object);
call->prev_execute_data = EX(call);
@@ -3367,7 +3392,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OP
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
}
@@ -3637,6 +3662,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HAN
}
if (UNEXPECTED(EG(exception) != NULL)) {
if (new_op_array != NULL) {
destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
}
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
zval *return_value = NULL;
@@ -4106,6 +4135,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(
SAVE_OPLINE();
val = EX_CONSTANT(opline->op1);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
HANDLE_EXCEPTION();
}
if (Z_TYPE_P(val) == IS_ARRAY) {
ZVAL_COPY_VALUE(&generator->values, val);
if (IS_CONST != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
@@ -4125,12 +4160,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(
if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
zend_generator_yield_from(generator, new_gen);
}
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
@@ -5582,13 +5619,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO
GC_REFCOUNT(obj)++; /* For $this pointer */
}
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5729,7 +5770,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -5749,6 +5790,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
function_name = EX_CONSTANT(opline->op2);
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
func = fcc.function_handler;
called_scope = fcc.called_scope;
object = fcc.object;
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
}
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
if (IS_CONST & (IS_VAR|IS_CV)) {
@@ -5758,25 +5812,27 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
object = fcc.object;
if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
if ((IS_CONST & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_CLOSURE) {
zend_object_release((zend_object*)func->common.prototype);
}
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
HANDLE_EXCEPTION();
}
} else {
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
efree(error);
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
func = (zend_function*)&zend_pass_function;
called_scope = NULL;
object = NULL;
@@ -5787,7 +5843,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -6065,7 +6121,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -7725,7 +7784,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -7879,7 +7938,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -9328,13 +9390,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV
GC_REFCOUNT(obj)++; /* For $this pointer */
}
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -9475,7 +9541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -9495,6 +9561,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var);
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
func = fcc.function_handler;
called_scope = fcc.called_scope;
object = fcc.object;
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
}
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
if (IS_CV & (IS_VAR|IS_CV)) {
@@ -9504,25 +9583,27 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
object = fcc.object;
if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
if ((IS_CV & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_CLOSURE) {
zend_object_release((zend_object*)func->common.prototype);
}
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
HANDLE_EXCEPTION();
}
} else {
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
efree(error);
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
func = (zend_function*)&zend_pass_function;
called_scope = NULL;
object = NULL;
@@ -9533,7 +9614,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -9541,6 +9622,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZE
USE_OPLINE
zend_class_entry *ce, *catch_ce;
zend_object *exception;
zval *ex;
SAVE_OPLINE();
/* Check whether an exception has been thrown, if not, jump over code */
@@ -9575,8 +9657,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZE
}
exception = EG(exception);
zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
ex = EX_VAR(opline->op2.var);
if (UNEXPECTED(Z_ISREF_P(ex))) {
ex = Z_REFVAL_P(ex);
}
zval_ptr_dtor(ex);
ZVAL_OBJ(ex, EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
HANDLE_EXCEPTION();
@@ -9754,7 +9840,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -11150,14 +11239,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM
GC_REFCOUNT(obj)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op2);
if ((IS_CONST & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -11298,7 +11391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -11318,6 +11411,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2);
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
func = fcc.function_handler;
called_scope = fcc.called_scope;
object = fcc.object;
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
zval_ptr_dtor_nogc(free_op2);
HANDLE_EXCEPTION();
}
}
if (func->common.fn_flags & ZEND_ACC_CLOSURE) {
/* Delay closure destruction until its invocation */
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) {
@@ -11327,25 +11433,28 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
GC_REFCOUNT((zend_object*)func->common.prototype)++;
call_info |= ZEND_CALL_CLOSURE;
}
called_scope = fcc.called_scope;
object = fcc.object;
if (object) {
call_info |= ZEND_CALL_RELEASE_THIS;
GC_REFCOUNT(object)++; /* For $this pointer */
}
if (error) {
efree(error);
/* This is the only soft error is_callable() can generate */
zend_error(E_DEPRECATED,
"Non-static method %s::%s() should not be called statically",
ZSTR_VAL(func->common.scope->name), ZSTR_VAL(func->common.function_name));
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
zval_ptr_dtor_nogc(free_op2);
if (((IS_TMP_VAR|IS_VAR) & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) {
if (call_info & ZEND_CALL_CLOSURE) {
zend_object_release((zend_object*)func->common.prototype);
}
if (call_info & ZEND_CALL_RELEASE_THIS) {
zend_object_release(object);
}
HANDLE_EXCEPTION();
}
} else {
zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
efree(error);
zval_ptr_dtor_nogc(free_op2);
if (UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
func = (zend_function*)&zend_pass_function;
called_scope = NULL;
object = NULL;
@@ -11356,8 +11465,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -11528,7 +11636,10 @@ num_index:
}
zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -12502,6 +12613,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE
SAVE_OPLINE();
val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (Z_TYPE_P(val) == IS_ARRAY) {
ZVAL_COPY_VALUE(&generator->values, val);
if (IS_TMP_VAR != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
@@ -12521,12 +12638,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE
if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
zend_generator_yield_from(generator, new_gen);
}
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
@@ -12989,7 +13108,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -13713,7 +13835,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -14262,7 +14387,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -14776,7 +14904,10 @@ num_index:
}
zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -15433,7 +15564,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCO
ZVAL_COPY(EX_VAR(opline->result.var), &object_zval);
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
}
@@ -16320,6 +16451,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE
SAVE_OPLINE();
val = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if (Z_TYPE_P(val) == IS_ARRAY) {
ZVAL_COPY_VALUE(&generator->values, val);
if (IS_VAR != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
@@ -16341,12 +16478,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE
if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
zend_generator_yield_from(generator, new_gen);
}
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
@@ -17669,7 +17808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -17873,7 +18012,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -18481,6 +18623,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLE
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
if (UNEXPECTED(free_op2)) {zval_ptr_dtor_nogc(free_op2);};
HANDLE_EXCEPTION();
}
@@ -19304,7 +19447,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19458,7 +19601,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -20767,6 +20913,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
HANDLE_EXCEPTION();
}
@@ -20945,7 +21092,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -21042,7 +21189,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -22534,7 +22684,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -22631,7 +22781,10 @@ num_index:
}
zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -23914,13 +24067,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
GC_REFCOUNT(obj)++; /* For $this pointer */
}
if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -26341,13 +26498,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
GC_REFCOUNT(obj)++; /* For $this pointer */
}
if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -27845,14 +28006,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T
GC_REFCOUNT(obj)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op2);
if ((IS_UNUSED & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -29290,6 +29455,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLE
}
if (UNEXPECTED(EG(exception) != NULL)) {
if (new_op_array != NULL) {
destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
}
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
zval *return_value = NULL;
@@ -29759,6 +29928,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN
SAVE_OPLINE();
val = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
HANDLE_EXCEPTION();
}
if (Z_TYPE_P(val) == IS_ARRAY) {
ZVAL_COPY_VALUE(&generator->values, val);
if (IS_CV != IS_TMP_VAR && Z_OPT_REFCOUNTED_P(val)) {
@@ -29778,12 +29953,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN
if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
zend_generator_yield_from(generator, new_gen);
}
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
@@ -32117,13 +32294,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST
GC_REFCOUNT(obj)++; /* For $this pointer */
}
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -32294,7 +32475,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -33583,6 +33767,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER
UNEXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) != IS_INDIRECT) &&
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
if (UNEXPECTED(free_op2)) {zval_ptr_dtor_nogc(free_op2);};
HANDLE_EXCEPTION();
}
@@ -34826,7 +35011,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -36998,6 +37186,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(
UNEXPECTED(!Z_ISREF_P(EX_VAR(opline->op1.var)))) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
HANDLE_EXCEPTION();
}
if (IS_CV == IS_VAR &&
@@ -37213,13 +37402,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA
GC_REFCOUNT(obj)++; /* For $this pointer */
}
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -37390,7 +37583,10 @@ num_index:
}
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -39805,14 +40001,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA
GC_REFCOUNT(obj)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op2);
if ((IS_CV & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -39983,7 +40183,10 @@ num_index:
}
zval_ptr_dtor_nogc(free_op2);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
zval_ptr_dtor(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -40816,6 +41019,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HA
}
zval_ptr_dtor_nogc(free_op1);
if (UNEXPECTED(EG(exception) != NULL)) {
if (new_op_array != NULL) {
destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
}
HANDLE_EXCEPTION();
} else if (EXPECTED(new_op_array != NULL)) {
zval *return_value = NULL;
@@ -42040,14 +42247,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
GC_REFCOUNT(obj)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op1);
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -44188,14 +44399,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
GC_REFCOUNT(obj)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op1);
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -45334,15 +45549,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T
GC_REFCOUNT(obj)++; /* For $this pointer */
}
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) && UNEXPECTED(EG(exception))) {
HANDLE_EXCEPTION();
}
call = zend_vm_stack_push_call_frame(call_info,
fbc, opline->extended_value, called_scope, obj);
call->prev_execute_data = EX(call);
EX(call) = call;
zval_ptr_dtor_nogc(free_op2);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_TMPVAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+6 -1
View File
@@ -2672,10 +2672,14 @@ AC_DEFUN([PHP_CONFIG_NICE],[
EOF
clean_configure_args=$ac_configure_args
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
eval val=\$$var
if test -n "$val"; then
echo "$var='$val' \\" >> $1
if test `expr "X$ac_configure_args" : ".*${var}.*"` != 0; then
clean_configure_args=$(echo $clean_configure_args | sed -e "s#'$var=$val'##")
fi
fi
done
@@ -2685,7 +2689,8 @@ EOF
else
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
fi
for arg in $ac_configure_args; do
for arg in $clean_configure_args; do
if test `expr -- $arg : "'.*"` = 0; then
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
continue;
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="RC1"
PHP_RELEASE_VERSION=14
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+4 -1
View File
@@ -49,7 +49,10 @@ _bc_new_num_ex (length, scale, persistent)
int length, scale, persistent;
{
bc_num temp;
/* PHP Change: add length check */
if ((size_t)length+(size_t)scale > INT_MAX) {
zend_error(E_ERROR, "Result too long, max is %d", INT_MAX);
}
/* PHP Change: malloc() -> pemalloc(), removed free_list code */
temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, persistent);
#if 0
+1 -2
View File
@@ -41,6 +41,5 @@
void bc_out_of_memory (void)
{
(void) fprintf (stderr, "bcmath: out of memory!\n");
exit (1);
zend_error(E_ERROR, "bcmath: out of memory!");
}
+31 -10
View File
@@ -148,7 +148,11 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count)
just_read = BZ2_bzread(self->bz_file, buf, to_read);
if (just_read < 1) {
stream->eof = 0 == just_read;
/* it is not safe to keep reading after an error, see #72613 */
stream->eof = 1;
if (just_read < 0) {
return -1;
}
break;
}
@@ -557,7 +561,8 @@ static PHP_FUNCTION(bzcompress)
Decompresses BZip2 compressed data */
static PHP_FUNCTION(bzdecompress)
{
char *source, *dest;
char *source;
zend_string *dest;
size_t source_len;
int error;
zend_long small = 0;
@@ -583,25 +588,41 @@ static PHP_FUNCTION(bzdecompress)
bzs.avail_in = source_len;
/* in most cases bz2 offers at least 2:1 compression, so we use that as our base */
dest = zend_string_safe_alloc(source_len, 2, 1, 0);
bzs.avail_out = source_len * 2;
bzs.next_out = dest = emalloc(bzs.avail_out + 1);
bzs.next_out = ZSTR_VAL(dest);
while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) {
/* compression is better then 2:1, need to allocate more memory */
bzs.avail_out = source_len;
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = safe_erealloc(dest, 1, bzs.avail_out+1, (size_t) size );
bzs.next_out = dest + size;
#if !ZEND_ENABLE_ZVAL_LONG64
if (size > SIZE_MAX) {
/* no reason to continue if we're going to drop it anyway */
break;
}
#endif
dest = zend_string_safe_realloc(dest, 1, bzs.avail_out+1, (size_t) size, 0);
bzs.next_out = ZSTR_VAL(dest) + size;
}
if (error == BZ_STREAM_END || error == BZ_OK) {
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = safe_erealloc(dest, 1, (size_t) size, 1);
dest[size] = '\0';
RETVAL_STRINGL(dest, (int) size);
efree(dest);
#if !ZEND_ENABLE_ZVAL_LONG64
if (UNEXPECTED(size > SIZE_MAX)) {
php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX);
zend_string_free(dest);
RETVAL_LONG(BZ_MEM_ERROR);
} else
#endif
{
dest = zend_string_safe_realloc(dest, 1, (size_t)size, 1, 0);
ZSTR_LEN(dest) = (size_t)size;
ZSTR_VAL(dest)[(size_t)size] = '\0';
RETVAL_STR(dest);
}
} else { /* real error */
efree(dest);
zend_string_free(dest);
RETVAL_LONG(error);
}
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #72447: Type Confusion in php_bz2_filter_create()
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
$input = "AAAAAAAA";
$param = array('blocks' => $input);
$fp = fopen('testfile', 'w');
stream_filter_append($fp, 'bzip2.compress', STREAM_FILTER_WRITE, $param);
fclose($fp);
?>
--EXPECTF--
Warning: stream_filter_append(): Invalid parameter given for number of blocks to allocate. (0) in %s%ebug72447.php on line %d
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #72613 (Inadequate error handling in bzread())
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
$fp = bzopen(__DIR__.'/72613.bz2', 'r');
if ($fp === FALSE) {
exit("ERROR: bzopen()");
}
$data = "";
while (!feof($fp)) {
$res = bzread($fp);
if ($res === FALSE) {
exit("ERROR: bzread()");
}
$data .= $res;
}
bzclose($fp);
?>
DONE
--EXPECT--
DONE
+18 -8
View File
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Shane Caraveo <shane@caraveo.com> |
| Authors: Shane Caraveo <shane@caraveo.com> |
| Colin Viebrock <colin@easydns.com> |
| Hartmut Holzgraefe <hholzgra@php.net> |
| Wez Furlong <wez@thebrainroom.com> |
@@ -357,6 +357,10 @@ PHP_FUNCTION(cal_days_in_month)
}
else {
sdn_next = calendar->to_jd(year + 1, 1, 1);
if (cal == CAL_FRENCH && sdn_next == 0) {
/* The French calendar ends on 0014-13-05. */
sdn_next = 2380953;
}
}
}
@@ -414,15 +418,21 @@ PHP_FUNCTION(cal_from_jd)
add_assoc_long(return_value, "year", year);
/* day of week */
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
if (cal != CAL_JEWISH || year > 0) {
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
} else {
add_assoc_null(return_value, "dow");
add_assoc_string(return_value, "abbrevdayname", "");
add_assoc_string(return_value, "dayname", "");
}
/* month name */
if(cal == CAL_JEWISH) {
/* special case for Jewish calendar */
add_assoc_string(return_value, "abbrevmonth", JEWISH_MONTH_NAME(year)[month]);
add_assoc_string(return_value, "monthname", JEWISH_MONTH_NAME(year)[month]);
add_assoc_string(return_value, "abbrevmonth", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
add_assoc_string(return_value, "monthname", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
} else {
add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month]);
add_assoc_string(return_value, "monthname", calendar->month_name_long[month]);
@@ -735,7 +745,7 @@ PHP_FUNCTION(jdmonthname)
break;
case CAL_MONTH_JEWISH: /* jewish month */
SdnToJewish(julday, &year, &month, &day);
monthname = JEWISH_MONTH_NAME(year)[month];
monthname = (year > 0 ? JEWISH_MONTH_NAME(year)[month] : "");
break;
case CAL_MONTH_FRENCH: /* french month */
SdnToFrench(julday, &year, &month, &day);
+1 -1
View File
@@ -195,7 +195,7 @@ zend_long GregorianToSdn(
int inputMonth,
int inputDay)
{
int year;
zend_long year;
int month;
/* check for invalid dates */
+1 -1
View File
@@ -217,7 +217,7 @@ zend_long JulianToSdn(
int inputMonth,
int inputDay)
{
int year;
zend_long year;
int month;
/* check for invalid dates */
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #67976 (cal_days_month() fails for final month of the French calendar)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
var_dump(cal_days_in_month(CAL_FRENCH, 13, 14));
?>
--EXPECT--
int(5)
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Bug #71894 (AddressSanitizer: global-buffer-overflow in zif_cal_from_jd)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
var_dump(cal_from_jd(347997, CAL_JEWISH));
var_dump(jdmonthname(347997,CAL_MONTH_JEWISH));?>
--EXPECT--
array(9) {
["date"]=>
string(5) "0/0/0"
["month"]=>
int(0)
["day"]=>
int(0)
["year"]=>
int(0)
["dow"]=>
NULL
["abbrevdayname"]=>
string(0) ""
["dayname"]=>
string(0) ""
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
string(0) ""
}
string(0) ""
@@ -0,0 +1,11 @@
--TEST--
gregoriantojd()
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
<?php include 'skipif.inc'; ?>
--FILE--
<?php
echo gregoriantojd(5, 5, 6000000) . "\n";
?>
--EXPECT--
2193176185
@@ -0,0 +1,28 @@
--TEST--
jdtogregorian(): test overflow
--CREDITS--
neweracracker@gmail.com
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only');
?>
--FILE--
<?php
for ($i=536838860; $i<536838870; $i++) {
echo $i, ':', jdtogregorian($i), PHP_EOL;
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
536838860:10/11/1465102
536838861:10/12/1465102
536838862:10/13/1465102
536838863:10/14/1465102
536838864:10/15/1465102
536838865:10/16/1465102
536838866:10/17/1465102
536838867:0/0/0
536838868:0/0/0
536838869:0/0/0
DONE
@@ -0,0 +1,27 @@
--TEST--
jdtojewish(): test overflow
--CREDITS--
neweracracker@gmail.com
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
for ($i=324542840; $i<324542850; $i++) {
echo $i, ':', jdtojewish($i), PHP_EOL;
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
324542840:12/7/887605
324542841:12/8/887605
324542842:12/9/887605
324542843:12/10/887605
324542844:12/11/887605
324542845:12/12/887605
324542846:12/13/887605
324542847:0/0/0
324542848:0/0/0
324542849:0/0/0
DONE
@@ -0,0 +1,11 @@
--TEST--
juliantojd()
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
<?php include 'skipif.inc'; ?>
--FILE--
<?php
echo juliantojd(5, 5, 6000000000) . "\n";
?>
--EXPECT--
622764916319
+6 -5
View File
@@ -553,7 +553,10 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
for (i = 0, j = 0; i < nargs; i++) {
/* if this was byref, update the zval */
if (f->arg_info[nargs - i - 1].pass_by_reference) {
SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]);
zval *arg = &args[nargs - i - 1];
ZVAL_DEREF(arg);
SEPARATE_ZVAL_NOREF(arg);
/* if the variant is pointing at the byref_vals, we need to map
* the pointee value as a zval; otherwise, the value is pointing
@@ -561,14 +564,12 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
if (V_VT(&vargs[i]) & VT_BYREF) {
if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
/* copy that value */
php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
obj->code_page);
php_com_zval_from_variant(arg, &byref_vals[j], obj->code_page);
}
} else {
/* not sure if this can ever happen; the variant we marked as BYREF
* is no longer BYREF - copy its value */
php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
obj->code_page);
php_com_zval_from_variant(arg, &vargs[i], obj->code_page);
}
VariantClear(&byref_vals[j]);
j++;
+8 -10
View File
@@ -279,7 +279,6 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
f.function_name = zend_string_copy(name);
f.handler = PHP_FN(com_method_handler);
zend_set_function_arg_flags((zend_function*)&f);
fptr = &f;
@@ -305,7 +304,7 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) {
f.arg_info[i].allow_null = 1;
if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) {
f.arg_info[i].pass_by_reference = 1;
f.arg_info[i].pass_by_reference = ZEND_SEND_BY_REF;
}
}
@@ -335,15 +334,14 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
}
}
if (fptr) {
/* save this method in the cache */
if (!obj->method_cache) {
ALLOC_HASHTABLE(obj->method_cache);
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
}
zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f));
zend_set_function_arg_flags((zend_function*)&f);
/* save this method in the cache */
if (!obj->method_cache) {
ALLOC_HASHTABLE(obj->method_cache);
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
}
zend_hash_update_mem(obj->method_cache, name, &f, sizeof(f));
}
if (fptr) {
+13 -1
View File
@@ -100,7 +100,12 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z));
zend_uchar ztype = IS_NULL;
if (z) {
ZVAL_DEREF(z);
ztype = Z_TYPE_P(z);
}
switch (ztype) {
case IS_NULL:
@@ -1007,6 +1012,13 @@ PHP_FUNCTION(variant_date_from_timestamp)
tzset();
ttstamp = timestamp;
tmv = localtime(&ttstamp);
#if ZEND_ENABLE_ZVAL_LONG64
/* Invalid after 23:59:59, December 31, 3000, UTC */
if (!tmv) {
php_error_docref(NULL, E_WARNING, "Invalid timestamp " ZEND_LONG_FMT, timestamp);
RETURN_FALSE;
}
#endif
memset(&systime, 0, sizeof(systime));
systime.wDay = tmv->tm_mday;
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72498 variant_date_from_timestamp null dereference
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
if (PHP_INT_SIZE != 8) print "skip 64-bit only";
?>
--FILE--
<?php
$v1 = PHP_INT_MAX;
var_dump(variant_date_from_timestamp($v1));
?>
--EXPECTF--
Warning: variant_date_from_timestamp(): Invalid timestamp %d in %sbug72498.php on line %d
bool(false)
+1
View File
@@ -137,6 +137,7 @@ ZEND_METHOD(CURLFile, setPostFilename)
Unserialization handler */
ZEND_METHOD(CURLFile, __wakeup)
{
zend_unset_property(curl_CURLFile_class, getThis(), "name", sizeof("name")-1);
zend_update_property_string(curl_CURLFile_class, getThis(), "name", sizeof("name")-1, "");
zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0);
}
+22 -49
View File
@@ -801,6 +801,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
#if LIBCURL_VERSION_NUM >= 0x072700 /* Available since 7.39.0 */
REGISTER_CURL_CONSTANT(CURLE_SSL_PINNEDPUBKEYNOTMATCH);
#endif
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT(CURLE_TOO_MANY_REDIRECTS);
REGISTER_CURL_CONSTANT(CURLE_UNKNOWN_TELNET_OPTION);
@@ -1876,38 +1879,6 @@ static php_curl *alloc_curl_handle()
/* }}} */
#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
/* {{{ split_certinfo
*/
static void split_certinfo(char *string, zval *hash)
{
char *org = estrdup(string);
char *s = org;
char *split;
if(org) {
do {
char *key;
char *val;
char *tmp;
split = strstr(s, "; ");
if(split)
*split = '\0';
key = s;
tmp = memchr(key, '=', 64);
if(tmp) {
*tmp = '\0';
val = tmp+1;
add_assoc_string(hash, key, val);
}
s = split+2;
} while(split);
efree(org);
}
}
/* }}} */
/* {{{ create_certinfo
*/
static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
@@ -1925,21 +1896,13 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
int len;
char s[64];
char *tmp;
strncpy(s, slist->data, 64);
tmp = memchr(s, ':', 64);
strncpy(s, slist->data, sizeof(s));
s[sizeof(s)-1] = '\0';
tmp = memchr(s, ':', sizeof(s));
if(tmp) {
*tmp = '\0';
len = strlen(s);
if (!strcmp(s, "Subject") || !strcmp(s, "Issuer")) {
zval hash;
array_init(&hash);
split_certinfo(&slist->data[len+1], &hash);
add_assoc_zval(&certhash, s, &hash);
} else {
add_assoc_string(&certhash, s, &slist->data[len+1]);
}
add_assoc_string(&certhash, s, &slist->data[len+1]);
} else {
php_error_docref(NULL, E_WARNING, "Could not extract hash key from certificate info");
}
@@ -2658,10 +2621,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
}
} ZEND_HASH_FOREACH_END();
if ((*ch->clone) == 1) {
zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
} else {
zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
if (slist) {
if ((*ch->clone) == 1) {
zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
} else {
zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
}
}
error = curl_easy_setopt(ch->cp, option, slist);
@@ -3556,7 +3521,7 @@ PHP_FUNCTION(curl_reset)
PHP_FUNCTION(curl_escape)
{
char *str = NULL, *res = NULL;
size_t str_len = 0;
size_t str_len = 0;
zval *zid;
php_curl *ch;
@@ -3568,6 +3533,10 @@ PHP_FUNCTION(curl_escape)
RETURN_FALSE;
}
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
RETURN_FALSE;
}
if ((res = curl_easy_escape(ch->cp, str, str_len))) {
RETVAL_STRING(res);
curl_free(res);
@@ -3595,6 +3564,10 @@ PHP_FUNCTION(curl_unescape)
RETURN_FALSE;
}
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
RETURN_FALSE;
}
if ((out = curl_easy_unescape(ch->cp, str, str_len, &out_len))) {
RETVAL_STRINGL(out, out_len);
curl_free(out);
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #73147: Use After Free in PHP7 unserialize()
--SKIPIF--
<?php
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
?>
--FILE--
<?php
$poc = 'a:1:{i:0;O:8:"CURLFile":1:{s:4:"name";R:1;}}';
try {
var_dump(unserialize($poc));
} catch(Exception $e) {
echo $e->getMessage();
}
?>
--EXPECT--
Unserialization of CURLFile instances is not allowed
+158 -1712
View File
File diff suppressed because it is too large. Load diff
+6 -2
View File
@@ -394,8 +394,12 @@ static timelib_sll timelib_meridian(char **ptr, timelib_sll h)
}
++*ptr;
if (**ptr == '.') {
*ptr += 3;
} else {
++*ptr;
}
if (**ptr == 'M' || **ptr == 'm') {
++*ptr;
}
if (**ptr == '.') {
++*ptr;
}
return retval;
+28 -28
View File
@@ -310,33 +310,33 @@ void timelib_dump_rel_time(timelib_rel_time *d)
timelib_long timelib_parse_tz_cor(char **ptr)
{
char *begin = *ptr, *end;
timelib_long tmp;
char *begin = *ptr, *end;
timelib_long tmp;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;
}
end = *ptr;
switch (end - begin) {
case 1:
case 2:
return HOUR(strtol(begin, NULL, 10));
break;
case 3:
case 4:
if (begin[1] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10);
return tmp;
} else if (begin[2] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
} else {
tmp = strtol(begin, NULL, 10);
return HOUR(tmp / 100) + tmp % 100;
}
case 5:
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
}
return 0;
while (isdigit(**ptr) || **ptr == ':') {
++*ptr;
}
end = *ptr;
switch (end - begin) {
case 1: /* H */
case 2: /* HH */
return HOUR(strtol(begin, NULL, 10));
break;
case 3: /* H:M */
case 4: /* H:MM, HH:M, HHMM */
if (begin[1] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10);
return tmp;
} else if (begin[2] == ':') {
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
} else {
tmp = strtol(begin, NULL, 10);
return HOUR(tmp / 100) + tmp % 100;
}
case 5: /* HH:MM */
tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10);
return tmp;
}
return 0;
}
+2 -2
View File
@@ -38,8 +38,8 @@
# define timelib_free free
#endif
#define TIMELIB_VERSION 201502
#define TIMELIB_ASCII_VERSION "2015.02"
#define TIMELIB_VERSION 201602
#define TIMELIB_ASCII_VERSION "2016.02"
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
Loaded 100 of 731 files, more files were not shown because too many files have changed in this diff. Show more