Compare commits

...
338 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 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
Stanislav Malyshev 8259130b6b Fix for #73240 - Write out of bounds at number_format 2016-10-10 23:42:50 -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
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 e1709b7e58 Fix bug #73082 2016-09-25 16:07:14 -07: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 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
252 changed files with 15299 additions and 11385 deletions

No files matched your search

+165
View File
@@ -1,5 +1,141 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
@@ -13,10 +149,23 @@ PHP NEWS
. 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)
@@ -38,6 +187,9 @@ PHP NEWS
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)
@@ -55,10 +207,13 @@ PHP NEWS
- 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)
@@ -82,11 +237,19 @@ PHP NEWS
. 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)
@@ -292,6 +455,8 @@ PHP NEWS
. 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
+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"
+3
View File
@@ -727,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
========================================
@@ -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)
}
+1 -1
View File
@@ -1,5 +1,5 @@
--TEST--
iBug #73156 (segfault on undefined function)
Bug #73156 (segfault on undefined function)
--FILE--
<?php
class A {
+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,
))
@@ -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
@@ -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;
+18
View File
@@ -3847,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;
+1
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);
+17 -19
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));
@@ -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);
}
+9 -1
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;
+42 -35
View File
@@ -5499,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);
@@ -5555,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);
@@ -5950,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;
}
}
}
+22 -5
View File
@@ -293,10 +293,7 @@ ZEND_METHOD(exception, __construct)
#define CHECK_EXC_TYPE(name, type) \
pvalue = zend_read_property(i_get_exception_base(object), (object), name, sizeof(name) - 1, 1, &value); \
if (Z_TYPE_P(pvalue) != IS_NULL && 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); \
zend_unset_property(i_get_exception_base(object), object, name, sizeof(name)-1); \
}
ZEND_METHOD(exception, __wakeup)
@@ -309,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);
}
}
/* }}} */
@@ -771,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);
+14 -6
View File
@@ -576,7 +576,6 @@ static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_execu
static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr)
{
zend_reference *ref;
zval garbage;
if (EXPECTED(!Z_ISREF_P(value_ptr))) {
ZVAL_NEW_REF(value_ptr, value_ptr);
@@ -586,9 +585,18 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
ref = Z_REF_P(value_ptr);
GC_REFCOUNT(ref)++;
ZVAL_COPY_VALUE(&garbage, 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);
zval_ptr_dtor(&garbage);
}
/* this should modify object only if it's empty */
@@ -1404,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;
@@ -1435,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)) {
+3
View File
@@ -852,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);
}
+6 -2
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);
}
+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
View File
@@ -736,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);
}
+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
+4
View File
@@ -68,6 +68,10 @@ typedef unsigned long int uint32_t;
#undef USE_LOCALE
#endif
#ifndef NO_INFNAN_CHECK
#define NO_INFNAN_CHECK
#endif
#ifdef WORDS_BIGENDIAN
#define IEEE_BIG_ENDIAN 1
#else
+53 -22
View File
@@ -3012,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)
@@ -3161,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)
@@ -3283,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) &&
@@ -3297,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;
@@ -3381,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);
@@ -3396,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);
@@ -3421,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)) {
@@ -3430,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;
@@ -3459,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)
@@ -4946,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();
}
}
@@ -5232,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();
}
+266 -100
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();
}
}
@@ -5594,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)
@@ -5741,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)
@@ -5761,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)) {
@@ -5770,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;
@@ -5799,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)
@@ -6077,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();
}
@@ -7737,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)
@@ -7891,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();
}
@@ -9340,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)
@@ -9487,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)
@@ -9507,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)) {
@@ -9516,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;
@@ -9545,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)
@@ -9771,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();
}
@@ -11167,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)
@@ -11315,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)
@@ -11335,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)) {
@@ -11344,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;
@@ -11373,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)
@@ -11545,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();
}
@@ -13014,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();
}
@@ -13738,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();
}
@@ -14287,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();
}
@@ -14801,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();
}
@@ -15458,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();
}
}
@@ -17702,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)
@@ -17906,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();
}
@@ -19338,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)
@@ -19492,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();
}
@@ -20980,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)
@@ -21077,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();
}
@@ -22569,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)
@@ -22666,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();
}
@@ -23949,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)
@@ -26376,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)
@@ -27880,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)
@@ -32164,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)
@@ -32341,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();
}
@@ -34874,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();
}
@@ -37262,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)
@@ -37439,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();
}
@@ -39854,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)
@@ -40032,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();
}
@@ -42093,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)
@@ -44241,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)
@@ -45387,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)
+1 -1
View File
@@ -2678,7 +2678,7 @@ EOF
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'//")
clean_configure_args=$(echo $clean_configure_args | sed -e "s#'$var=$val'##")
fi
fi
done
+1 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=12
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!");
}
+1 -1
View File
@@ -588,8 +588,8 @@ 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;
dest = zend_string_alloc(bzs.avail_out + 1, 0);
bzs.next_out = ZSTR_VAL(dest);
while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) {
+1 -1
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> |
+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 */
@@ -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,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
+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);
}
+3
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);
+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
+104 -100
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.15.3 on Sun Jul 24 14:52:04 2016 */
/* Generated by re2c 0.15.3 on Fri Sep 30 20:30:54 2016 */
#line 1 "ext/date/lib/parse_date.re"
/*
* The MIT License (MIT)
@@ -396,8 +396,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;
@@ -820,11 +824,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
std:
s->tok = cursor;
s->len = 0;
#line 946 "ext/date/lib/parse_date.re"
#line 950 "ext/date/lib/parse_date.re"
#line 828 "<stdout>"
#line 832 "<stdout>"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -959,7 +963,7 @@ yy2:
}
}
yy3:
#line 1626 "ext/date/lib/parse_date.re"
#line 1630 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -972,7 +976,7 @@ yy3:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 976 "<stdout>"
#line 980 "<stdout>"
yy4:
yych = *++YYCURSOR;
if (yych <= 'E') {
@@ -1272,12 +1276,12 @@ yy11:
if (yych <= '/') goto yy12;
if (yych <= '9') goto yy1385;
yy12:
#line 1721 "ext/date/lib/parse_date.re"
#line 1725 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1281 "<stdout>"
#line 1285 "<stdout>"
yy13:
yych = *++YYCURSOR;
if (yych <= 'R') {
@@ -2291,22 +2295,22 @@ yy48:
if (yych <= '/') goto yy49;
if (yych <= '9') goto yy54;
yy49:
#line 1710 "ext/date/lib/parse_date.re"
#line 1714 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2299 "<stdout>"
#line 2303 "<stdout>"
yy50:
yych = *++YYCURSOR;
goto yy49;
yy51:
++YYCURSOR;
#line 1715 "ext/date/lib/parse_date.re"
#line 1719 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2310 "<stdout>"
#line 2314 "<stdout>"
yy53:
yych = *++YYCURSOR;
goto yy12;
@@ -2673,7 +2677,7 @@ yy71:
if (yych == 'S') goto yy73;
if (yych == 's') goto yy73;
yy72:
#line 1694 "ext/date/lib/parse_date.re"
#line 1698 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2688,7 +2692,7 @@ yy72:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2692 "<stdout>"
#line 2696 "<stdout>"
yy73:
yych = *++YYCURSOR;
if (yych == 'D') goto yy74;
@@ -3356,7 +3360,7 @@ yy165:
}
}
yy166:
#line 1557 "ext/date/lib/parse_date.re"
#line 1561 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -3373,7 +3377,7 @@ yy166:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3377 "<stdout>"
#line 3381 "<stdout>"
yy167:
yych = *++YYCURSOR;
if (yych <= 'K') {
@@ -3866,7 +3870,7 @@ yy192:
}
}
yy193:
#line 1616 "ext/date/lib/parse_date.re"
#line 1620 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -3875,7 +3879,7 @@ yy193:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 3879 "<stdout>"
#line 3883 "<stdout>"
yy194:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 21) YYFILL(21);
@@ -3921,7 +3925,7 @@ yy197:
}
}
yy198:
#line 1362 "ext/date/lib/parse_date.re"
#line 1366 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -3934,7 +3938,7 @@ yy198:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 3938 "<stdout>"
#line 3942 "<stdout>"
yy199:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
@@ -4179,7 +4183,7 @@ yy221:
if (yych <= ':') goto yy224;
}
yy222:
#line 1664 "ext/date/lib/parse_date.re"
#line 1668 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -4208,7 +4212,7 @@ yy222:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4212 "<stdout>"
#line 4216 "<stdout>"
yy223:
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
@@ -4850,7 +4854,7 @@ yy276:
}
yy277:
++YYCURSOR;
#line 1640 "ext/date/lib/parse_date.re"
#line 1644 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -4873,7 +4877,7 @@ yy277:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4877 "<stdout>"
#line 4881 "<stdout>"
yy279:
yych = *++YYCURSOR;
if (yych <= 0x1F) {
@@ -5035,7 +5039,7 @@ yy292:
yy293:
++YYCURSOR;
yy294:
#line 1334 "ext/date/lib/parse_date.re"
#line 1338 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -5048,7 +5052,7 @@ yy294:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5052 "<stdout>"
#line 5056 "<stdout>"
yy295:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -6199,7 +6203,7 @@ yy361:
if ((yych = *YYCURSOR) <= '/') goto yy363;
if (yych <= '9') goto yy364;
yy363:
#line 1478 "ext/date/lib/parse_date.re"
#line 1482 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -6212,7 +6216,7 @@ yy363:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6216 "<stdout>"
#line 6220 "<stdout>"
yy364:
yych = *++YYCURSOR;
if (yych <= '/') goto yy363;
@@ -6821,7 +6825,7 @@ yy391:
if (yych <= 'z') goto yy142;
}
yy392:
#line 1536 "ext/date/lib/parse_date.re"
#line 1540 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -6841,7 +6845,7 @@ yy392:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 6845 "<stdout>"
#line 6849 "<stdout>"
yy393:
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
@@ -8529,7 +8533,7 @@ yy452:
yy453:
++YYCURSOR;
yy454:
#line 1239 "ext/date/lib/parse_date.re"
#line 1243 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -8540,7 +8544,7 @@ yy454:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 8544 "<stdout>"
#line 8548 "<stdout>"
yy455:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9076,7 +9080,7 @@ yy474:
}
}
yy475:
#line 1376 "ext/date/lib/parse_date.re"
#line 1380 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9087,7 +9091,7 @@ yy475:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9091 "<stdout>"
#line 9095 "<stdout>"
yy476:
yyaccept = 10;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9215,7 +9219,7 @@ yy485:
}
yy487:
++YYCURSOR;
#line 1094 "ext/date/lib/parse_date.re"
#line 1098 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9231,7 +9235,7 @@ yy487:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9235 "<stdout>"
#line 9239 "<stdout>"
yy489:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9242,7 +9246,7 @@ yy489:
if (yych <= ':') goto yy492;
}
yy490:
#line 1131 "ext/date/lib/parse_date.re"
#line 1135 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -9267,7 +9271,7 @@ yy490:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9271 "<stdout>"
#line 9275 "<stdout>"
yy491:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9544,7 +9548,7 @@ yy520:
}
yy522:
++YYCURSOR;
#line 1111 "ext/date/lib/parse_date.re"
#line 1115 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -9563,7 +9567,7 @@ yy522:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9567 "<stdout>"
#line 9571 "<stdout>"
yy524:
yyaccept = 11;
YYMARKER = ++YYCURSOR;
@@ -9658,7 +9662,7 @@ yy533:
if ((yych = *YYCURSOR) <= '/') goto yy534;
if (yych <= '9') goto yy540;
yy534:
#line 1293 "ext/date/lib/parse_date.re"
#line 1297 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -9672,7 +9676,7 @@ yy534:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 9676 "<stdout>"
#line 9680 "<stdout>"
yy535:
yych = *++YYCURSOR;
if (yych == 'M') goto yy536;
@@ -10336,7 +10340,7 @@ yy604:
if (yych <= '/') goto yy56;
if (yych >= ':') goto yy56;
++YYCURSOR;
#line 1308 "ext/date/lib/parse_date.re"
#line 1312 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -10347,7 +10351,7 @@ yy604:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 10351 "<stdout>"
#line 10355 "<stdout>"
yy607:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -10378,7 +10382,7 @@ yy610:
if (yych <= '/') goto yy611;
if (yych <= '9') goto yy604;
yy611:
#line 1320 "ext/date/lib/parse_date.re"
#line 1324 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -10391,7 +10395,7 @@ yy611:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 10395 "<stdout>"
#line 10399 "<stdout>"
yy612:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -10987,7 +10991,7 @@ yy655:
}
}
yy656:
#line 1279 "ext/date/lib/parse_date.re"
#line 1283 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11000,7 +11004,7 @@ yy656:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11004 "<stdout>"
#line 11008 "<stdout>"
yy657:
yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
@@ -11096,7 +11100,7 @@ yy665:
}
}
yy666:
#line 1223 "ext/date/lib/parse_date.re"
#line 1227 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -11111,7 +11115,7 @@ yy666:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11115 "<stdout>"
#line 11119 "<stdout>"
yy667:
yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
@@ -11310,7 +11314,7 @@ yy699:
if (yych <= '9') goto yy702;
if (yych <= ':') goto yy703;
yy700:
#line 1506 "ext/date/lib/parse_date.re"
#line 1510 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -11330,7 +11334,7 @@ yy700:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 11334 "<stdout>"
#line 11338 "<stdout>"
yy701:
yych = *++YYCURSOR;
if (yych <= '5') {
@@ -11817,7 +11821,7 @@ yy762:
if (yych <= 't') goto yy662;
}
yy763:
#line 1251 "ext/date/lib/parse_date.re"
#line 1255 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -11830,7 +11834,7 @@ yy763:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11834 "<stdout>"
#line 11838 "<stdout>"
yy764:
yych = *++YYCURSOR;
if (yych == 'C') goto yy765;
@@ -11861,7 +11865,7 @@ yy769:
if (yych >= '2') goto yy56;
yy770:
++YYCURSOR;
#line 1492 "ext/date/lib/parse_date.re"
#line 1496 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -11874,7 +11878,7 @@ yy770:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 11878 "<stdout>"
#line 11882 "<stdout>"
yy772:
yych = *++YYCURSOR;
if (yych == 'V') goto yy765;
@@ -11999,7 +12003,7 @@ yy782:
default: goto yy783;
}
yy783:
#line 1527 "ext/date/lib/parse_date.re"
#line 1531 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -12007,7 +12011,7 @@ yy783:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12011 "<stdout>"
#line 12015 "<stdout>"
yy784:
yych = *++YYCURSOR;
switch (yych) {
@@ -12145,7 +12149,7 @@ yy792:
if (yych <= 'X') goto yy883;
}
yy793:
#line 1348 "ext/date/lib/parse_date.re"
#line 1352 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -12158,7 +12162,7 @@ yy793:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 12162 "<stdout>"
#line 12166 "<stdout>"
yy794:
yych = *++YYCURSOR;
if (yych == 'I') goto yy927;
@@ -12352,7 +12356,7 @@ yy813:
if (yych <= '/') goto yy814;
if (yych <= '7') goto yy816;
yy814:
#line 1459 "ext/date/lib/parse_date.re"
#line 1463 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -12370,14 +12374,14 @@ yy814:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 12374 "<stdout>"
#line 12378 "<stdout>"
yy815:
yych = *++YYCURSOR;
if (yych <= '/') goto yy56;
if (yych >= '8') goto yy56;
yy816:
++YYCURSOR;
#line 1440 "ext/date/lib/parse_date.re"
#line 1444 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -12395,7 +12399,7 @@ yy816:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 12399 "<stdout>"
#line 12403 "<stdout>"
yy818:
yych = *++YYCURSOR;
if (yych <= '/') goto yy60;
@@ -12455,7 +12459,7 @@ yy820:
}
}
yy821:
#line 1426 "ext/date/lib/parse_date.re"
#line 1430 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -12468,7 +12472,7 @@ yy821:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 12472 "<stdout>"
#line 12476 "<stdout>"
yy822:
yych = *++YYCURSOR;
if (yych <= '/') goto yy60;
@@ -12550,7 +12554,7 @@ yy840:
yy841:
++YYCURSOR;
yy842:
#line 1400 "ext/date/lib/parse_date.re"
#line 1404 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -12575,7 +12579,7 @@ yy842:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 12579 "<stdout>"
#line 12583 "<stdout>"
yy843:
yych = *++YYCURSOR;
if (yych <= '2') {
@@ -12831,7 +12835,7 @@ yy847:
}
}
yy848:
#line 1388 "ext/date/lib/parse_date.re"
#line 1392 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -12842,7 +12846,7 @@ yy848:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 12846 "<stdout>"
#line 12850 "<stdout>"
yy849:
yych = *++YYCURSOR;
if (yych <= 'H') {
@@ -13636,7 +13640,7 @@ yy972:
if (yych <= '/') goto yy973;
if (yych <= '9') goto yy995;
yy973:
#line 1265 "ext/date/lib/parse_date.re"
#line 1269 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -13649,7 +13653,7 @@ yy973:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 13653 "<stdout>"
#line 13657 "<stdout>"
yy974:
yyaccept = 22;
yych = *(YYMARKER = ++YYCURSOR);
@@ -14561,7 +14565,7 @@ yy1065:
default: goto yy1067;
}
yy1067:
#line 1157 "ext/date/lib/parse_date.re"
#line 1161 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -14583,7 +14587,7 @@ yy1067:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 14587 "<stdout>"
#line 14591 "<stdout>"
yy1068:
yych = *++YYCURSOR;
if (yych <= '/') goto yy60;
@@ -14667,7 +14671,7 @@ yy1074:
}
}
yy1075:
#line 1203 "ext/date/lib/parse_date.re"
#line 1207 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -14686,7 +14690,7 @@ yy1075:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 14690 "<stdout>"
#line 14694 "<stdout>"
yy1076:
yyaccept = 25;
yych = *(YYMARKER = ++YYCURSOR);
@@ -15542,7 +15546,7 @@ yy1116:
}
}
yy1117:
#line 1599 "ext/date/lib/parse_date.re"
#line 1603 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -15558,7 +15562,7 @@ yy1117:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 15562 "<stdout>"
#line 15566 "<stdout>"
yy1118:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -15600,7 +15604,7 @@ yy1124:
if (yych != 'f') goto yy56;
yy1125:
++YYCURSOR;
#line 1072 "ext/date/lib/parse_date.re"
#line 1076 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -15621,7 +15625,7 @@ yy1125:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 15625 "<stdout>"
#line 15629 "<stdout>"
yy1127:
yyaccept = 26;
yych = *(YYMARKER = ++YYCURSOR);
@@ -15714,7 +15718,7 @@ yy1140:
}
}
yy1141:
#line 1575 "ext/date/lib/parse_date.re"
#line 1579 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -15737,7 +15741,7 @@ yy1141:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 15741 "<stdout>"
#line 15745 "<stdout>"
yy1142:
yych = *++YYCURSOR;
goto yy1117;
@@ -18261,7 +18265,7 @@ yy1293:
if (yych <= '9') goto yy1296;
goto yy1297;
yy1294:
#line 1049 "ext/date/lib/parse_date.re"
#line 1053 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -18283,7 +18287,7 @@ yy1294:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 18287 "<stdout>"
#line 18291 "<stdout>"
yy1295:
yyaccept = 28;
yych = *(YYMARKER = ++YYCURSOR);
@@ -18522,7 +18526,7 @@ yy1314:
if (yych != 'f') goto yy56;
yy1315:
++YYCURSOR;
#line 1032 "ext/date/lib/parse_date.re"
#line 1036 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -18538,7 +18542,7 @@ yy1315:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 18542 "<stdout>"
#line 18546 "<stdout>"
yy1317:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -19898,7 +19902,7 @@ yy1385:
if (yych <= '/') goto yy1387;
if (yych <= '9') goto yy1385;
yy1387:
#line 1006 "ext/date/lib/parse_date.re"
#line 1010 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -19923,7 +19927,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 19927 "<stdout>"
#line 19931 "<stdout>"
yy1388:
yych = *++YYCURSOR;
if (yych <= 'N') {
@@ -20329,7 +20333,7 @@ yy1415:
yy1416:
++YYCURSOR;
yy1417:
#line 994 "ext/date/lib/parse_date.re"
#line 998 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -20340,7 +20344,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 20344 "<stdout>"
#line 20348 "<stdout>"
yy1418:
yych = *++YYCURSOR;
if (yych <= 'Y') {
@@ -20372,7 +20376,7 @@ yy1419:
if (yych <= 'z') goto yy144;
}
yy1420:
#line 984 "ext/date/lib/parse_date.re"
#line 988 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -20381,7 +20385,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 20385 "<stdout>"
#line 20389 "<stdout>"
yy1421:
yych = *++YYCURSOR;
if (yych <= 'S') {
@@ -22313,7 +22317,7 @@ yy1499:
if (yych <= 'z') goto yy142;
}
yy1500:
#line 963 "ext/date/lib/parse_date.re"
#line 967 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -22321,7 +22325,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22325 "<stdout>"
#line 22329 "<stdout>"
yy1501:
yych = *++YYCURSOR;
if (yych <= 'N') {
@@ -22452,7 +22456,7 @@ yy1507:
if (yych <= 'z') goto yy143;
}
yy1508:
#line 972 "ext/date/lib/parse_date.re"
#line 976 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -22463,7 +22467,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22467 "<stdout>"
#line 22471 "<stdout>"
yy1509:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -22973,7 +22977,7 @@ yy1529:
yy1530:
++YYCURSOR;
yy1531:
#line 951 "ext/date/lib/parse_date.re"
#line 955 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -22984,7 +22988,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22988 "<stdout>"
#line 22992 "<stdout>"
yy1532:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -23149,7 +23153,7 @@ yy1537:
goto yy1531;
}
}
#line 1725 "ext/date/lib/parse_date.re"
#line 1729 "ext/date/lib/parse_date.re"
}
+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;
+2818 -2783
View File
File diff suppressed because it is too large. Load diff
+49
View File
@@ -1970,6 +1970,54 @@ static int implement_date_interface_handler(zend_class_entry *interface, zend_cl
return SUCCESS;
} /* }}} */
static int date_interval_has_property(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
{
php_interval_obj *obj;
zval tmp_member;
zval rv;
zval *prop;
int retval = 0;
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_COPY(&tmp_member, member);
convert_to_string(&tmp_member);
member = &tmp_member;
cache_slot = NULL;
}
obj = Z_PHPINTERVAL_P(object);
if (!obj->initialized) {
retval = (zend_get_std_object_handlers())->has_property(object, member, type, cache_slot);
if (member == &tmp_member) {
zval_dtor(member);
}
return retval;
}
prop = date_interval_read_property(object, member, type, cache_slot, &rv);
if (prop != NULL) {
if (type == 2) {
retval = 1;
} else if (type == 1) {
retval = zend_is_true(prop);
} else if (type == 0) {
retval = (Z_TYPE(*prop) != IS_NULL);
}
} else {
retval = (zend_get_std_object_handlers())->has_property(object, member, type, cache_slot);
}
if (member == &tmp_member) {
zval_dtor(member);
}
return retval;
}
/* }}} */
static void date_register_classes(void) /* {{{ */
{
zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface;
@@ -2051,6 +2099,7 @@ static void date_register_classes(void) /* {{{ */
date_object_handlers_interval.offset = XtOffsetOf(php_interval_obj, std);
date_object_handlers_interval.free_obj = date_object_free_storage_interval;
date_object_handlers_interval.clone_obj = date_object_clone_interval;
date_object_handlers_interval.has_property = date_interval_has_property;
date_object_handlers_interval.read_property = date_interval_read_property;
date_object_handlers_interval.write_property = date_interval_write_property;
date_object_handlers_interval.get_properties = date_object_get_properties_interval;
+6 -6
View File
@@ -75,8 +75,8 @@ result = Monday 1983-04-18 01:00:00 CEST
wanted = Monday 00:00:00
Asia/Yerevan
ts = Monday 2037-10-19 17:17:17 AMT
result = Monday 2037-10-26 00:00:00 AMT
ts = Monday 2037-10-19 17:17:17 +04
result = Monday 2037-10-26 00:00:00 +04
wanted = Monday 00:00:00
America/Curacao
@@ -115,8 +115,8 @@ result = Monday 1971-04-05 00:00:00 AST
wanted = Monday 00:00:00
Asia/Baku
ts = Friday 1971-01-01 17:17:17 BAKT
result = Monday 1971-01-04 00:00:00 BAKT
ts = Friday 1971-01-01 17:17:17 +04
result = Monday 1971-01-04 00:00:00 +04
wanted = Monday 00:00:00
Europe/Sarajevo
@@ -165,6 +165,6 @@ result = Monday 1980-04-07 00:00:00 CEST
wanted = Monday 00:00:00
Asia/Baku
ts = Monday 1995-12-25 17:17:17 AZT
result = Monday 1996-01-01 00:00:00 AZT
ts = Monday 1995-12-25 17:17:17 +04
result = Monday 1996-01-01 00:00:00 +04
wanted = Monday 00:00:00
+2 -2
View File
@@ -226,8 +226,8 @@ result=Thursday 1980-04-10 00:00:00 CEST 1
wanted=Thursday 00:00:00
TZ=Asia/Baku - wrong day.
tStamp=Sunday 1992-09-20 17:17:17 AZST 1
result=Monday 1992-09-28 00:00:00 AZT 0
tStamp=Sunday 1992-09-20 17:17:17 +04 1
result=Monday 1992-09-28 00:00:00 +04 0
wanted=Monday 00:00:00
TZ=America/Noronha - wrong day.
+2 -2
View File
@@ -28,6 +28,6 @@ result=Monday 1990-10-22 00:00:00 WART 0
wanted=Monday 00:00:00
TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?
tStamp=Sunday 2005-03-20 17:17:17 GET 0
result=Sunday 2005-03-27 00:00:00 GET 0
tStamp=Sunday 2005-03-20 17:17:17 +03 0
result=Sunday 2005-03-27 00:00:00 +03 0
wanted=Sunday 00:00:00
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #69587 (DateInterval properties and isset)
--FILE--
<?php
$datetime1 = new DateTime('2009-10-11');
$datetime2 = new DateTime('2009-10-13');
$interval = $datetime1->diff($datetime2);
var_dump(property_exists($interval, 'm'), isset($interval->m), empty($interval->m), empty($interval->d));
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(false)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Test date_interval_format() function : basic functionality
--CREDITS--
Jean Carlo Machado <contato@jeancarlomachado.com.br>
--INI--
date.timezone=UTC
--FILE--
<?php
$interval = new DateInterval('P2Y4DT6H8M');
echo date_interval_format($interval, '%d days');
echo PHP_EOL;
$interval = new DateInterval('P32D');
echo date_interval_format($interval, '%d days');
?>
--EXPECTF--
4 days
32 days
+2 -2
View File
@@ -1663,7 +1663,7 @@ PHP_FUNCTION(dom_document_savexml)
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
if (!size) {
if (!size || !mem) {
RETURN_FALSE;
}
RETVAL_STRINGL((char *) mem, size);
@@ -2215,7 +2215,7 @@ PHP_FUNCTION(dom_document_save_html)
#else
htmlDocDumpMemory(docp, &mem, &size);
#endif
if (!size) {
if (!size || !mem) {
RETVAL_FALSE;
} else {
RETVAL_STRINGL((const char*) mem, size);
+7 -4
View File
@@ -1036,7 +1036,7 @@ void php_gd_error_method(int type, const char *format, va_list args)
default:
type = E_ERROR;
}
php_verror(NULL, "", type, format, args TSRMLS_CC);
php_verror(NULL, "", type, format, args);
}
/* }}} */
#endif
@@ -3040,7 +3040,7 @@ PHP_FUNCTION(imagegammacorrect)
}
if ( input <= 0.0 || output <= 0.0 ) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive");
php_error_docref(NULL, E_WARNING, "Gamma values should be positive");
RETURN_FALSE;
}
@@ -4668,7 +4668,7 @@ PHP_FUNCTION(imagecropauto)
case GD_CROP_THRESHOLD:
if (color < 0 || (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode");
php_error_docref(NULL, E_WARNING, "Color argument missing with threshold mode");
RETURN_FALSE;
}
im_crop = gdImageCropThreshold(im, color, (float) threshold);
@@ -4695,7 +4695,7 @@ PHP_FUNCTION(imagescale)
gdImagePtr im_scaled = NULL;
int new_width, new_height;
zend_long tmp_w, tmp_h=-1, tmp_m = GD_BILINEAR_FIXED;
gdInterpolationMethod method;
gdInterpolationMethod method, old_method;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
return;
@@ -4724,9 +4724,12 @@ PHP_FUNCTION(imagescale)
new_width = tmp_w;
new_height = tmp_h;
/* gdImageGetInterpolationMethod() is only available as of GD 2.1.1 */
old_method = im->interpolation_id;
if (gdImageSetInterpolationMethod(im, method)) {
im_scaled = gdImageScale(im, new_width, new_height);
}
gdImageSetInterpolationMethod(im, old_method);
if (im_scaled == NULL) {
RETURN_FALSE;
+33 -66
View File
@@ -1115,7 +1115,7 @@ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
}
/* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im))) {
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) {
return;
}
@@ -1296,58 +1296,13 @@ inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color
void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
{
/* keep them as 32bits */
long x, y, inc;
long x, y, inc, frac;
long dx, dy,tmp;
if (y1 < 0 && y2 < 0) {
/* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */
if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)-1) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im)-1)) {
return;
}
if (y1 < 0) {
x1 += (y1 * (x1 - x2)) / (y2 - y1);
y1 = 0;
}
if (y2 < 0) {
x2 += (y2 * (x1 - x2)) / (y2 - y1);
y2 = 0;
}
/* bottom edge */
if (y1 >= im->sy && y2 >= im->sy) {
return;
}
if (y1 >= im->sy) {
x1 -= ((im->sy - y1) * (x1 - x2)) / (y2 - y1);
y1 = im->sy - 1;
}
if (y2 >= im->sy) {
x2 -= ((im->sy - y2) * (x1 - x2)) / (y2 - y1);
y2 = im->sy - 1;
}
/* left edge */
if (x1 < 0 && x2 < 0) {
return;
}
if (x1 < 0) {
y1 += (x1 * (y1 - y2)) / (x2 - x1);
x1 = 0;
}
if (x2 < 0) {
y2 += (x2 * (y1 - y2)) / (x2 - x1);
x2 = 0;
}
/* right edge */
if (x1 >= im->sx && x2 >= im->sx) {
return;
}
if (x1 >= im->sx) {
y1 -= ((im->sx - x1) * (y1 - y2)) / (x2 - x1);
x1 = im->sx - 1;
}
if (x2 >= im->sx) {
y2 -= ((im->sx - x2) * (y1 - y2)) / (x2 - x1);
x2 = im->sx - 1;
}
dx = x2 - x1;
dy = y2 - y1;
@@ -1366,16 +1321,22 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
dx = x2 - x1;
dy = y2 - y1;
}
x = x1 << 16;
y = y1 << 16;
y = y1;
inc = (dy * 65536) / dx;
while ((x >> 16) <= x2) {
gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);
if ((y >> 16) + 1 < im->sy) {
gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);
frac = 0;
for (x = x1; x <= x2; x++) {
gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF);
if (y + 1 < im->sy) {
gdImageSetAAPixelColor(im, x, y + 1, col, (~frac >> 8) & 0xFF);
}
frac += inc;
if (frac >= 65536) {
frac -= 65536;
y++;
} else if (frac < 0) {
frac += 65536;
y--;
}
x += (1 << 16);
y += inc;
}
} else {
if (dy < 0) {
@@ -1388,16 +1349,22 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col)
dx = x2 - x1;
dy = y2 - y1;
}
x = x1 << 16;
y = y1 << 16;
x = x1;
inc = (dx * 65536) / dy;
while ((y>>16) <= y2) {
gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF);
if ((x >> 16) + 1 < im->sx) {
gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);
frac = 0;
for (y = y1; y <= y2; y++) {
gdImageSetAAPixelColor(im, x, y, col, (frac >> 8) & 0xFF);
if (x + 1 < im->sx) {
gdImageSetAAPixelColor(im, x + 1, y, col, (~frac >> 8) & 0xFF);
}
frac += inc;
if (frac >= 65536) {
frac -= 65536;
x++;
} else if (frac < 0) {
frac += 65536;
x--;
}
x += inc;
y += (1<<16);
}
}
}
@@ -1778,7 +1745,7 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
int leftLimit = -1, rightLimit;
int i, restoreAlphaBlending = 0;
if (border < 0) {
if (border < 0 || color < 0) {
/* Refuse to fill to a non-solid border */
return;
}
+4
View File
@@ -243,6 +243,10 @@ gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const f
return NULL;
}
if (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im)) {
return NULL;
}
/* TODO: Add gdImageGetRowPtr and works with ptr at the row level
* for the true color and palette images
* new formats will simply work with ptr
+4 -4
View File
@@ -1331,10 +1331,10 @@ static gdImagePtr gdImageScaleBilinearPalette(gdImagePtr im, const unsigned int
f_a4 = gd_itofx(gdTrueColorGetAlpha(pixel4));
{
const char red = (char) gd_fxtoi(gd_mulfx(f_w1, f_r1) + gd_mulfx(f_w2, f_r2) + gd_mulfx(f_w3, f_r3) + gd_mulfx(f_w4, f_r4));
const char green = (char) gd_fxtoi(gd_mulfx(f_w1, f_g1) + gd_mulfx(f_w2, f_g2) + gd_mulfx(f_w3, f_g3) + gd_mulfx(f_w4, f_g4));
const char blue = (char) gd_fxtoi(gd_mulfx(f_w1, f_b1) + gd_mulfx(f_w2, f_b2) + gd_mulfx(f_w3, f_b3) + gd_mulfx(f_w4, f_b4));
const char alpha = (char) gd_fxtoi(gd_mulfx(f_w1, f_a1) + gd_mulfx(f_w2, f_a2) + gd_mulfx(f_w3, f_a3) + gd_mulfx(f_w4, f_a4));
const unsigned char red = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_r1) + gd_mulfx(f_w2, f_r2) + gd_mulfx(f_w3, f_r3) + gd_mulfx(f_w4, f_r4));
const unsigned char green = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_g1) + gd_mulfx(f_w2, f_g2) + gd_mulfx(f_w3, f_g3) + gd_mulfx(f_w4, f_g4));
const unsigned char blue = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_b1) + gd_mulfx(f_w2, f_b2) + gd_mulfx(f_w3, f_b3) + gd_mulfx(f_w4, f_b4));
const unsigned char alpha = (unsigned char) gd_fxtoi(gd_mulfx(f_w1, f_a1) + gd_mulfx(f_w2, f_a2) + gd_mulfx(f_w3, f_a3) + gd_mulfx(f_w4, f_a4));
new_img->tpixels[dst_offset_v][dst_offset_h] = gdTrueColorAlpha(red, green, blue, alpha);
}
+1 -1
View File
@@ -237,7 +237,7 @@ static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len)
if (remain >= len) {
rlen = len;
} else {
if (remain == 0) {
if (remain <= 0) {
return EOF;
}
rlen = remain;
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #72482 (Ilegal write/read access caused by gdImageAALine overflow)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$img = imagecreatetruecolor(13, 1007);
imageantialias($img, true);
imageline($img, 0, 0, 1073745919, 1073745919, 4096);
$img = imagecreatetruecolor(100, 100);
imageantialias($img, true);
imageline($img, 1094795585, 0, 2147483647, 255, 0xff);
?>
===DONE===
--EXPECT--
===DONE===
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug 72482 (Ilegal write/read access caused by gdImageAALine overflow)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
$im = imagecreatetruecolor(10, 10);
imagefilledrectangle($im, 0, 0, 9, 9, imagecolorallocate($im, 255, 255, 255));
imageantialias($im, true);
imageline($im, 0, 0, 10, 10, imagecolorallocate($im, 0, 0, 0));
test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'bug72482_2.png', $im);
?>
===DONE===
--EXPECT--
The images are equal.
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #72494 (imagecropauto out-of-bounds access)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$im = imagecreate(10,10);
imagecropauto($im, IMG_CROP_THRESHOLD, 0, 1337);
?>
===DONE===
--EXPECTF--
Warning: imagecropauto(): Color argument missing with threshold mode in %s on line %d
===DONE===
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #72696 (imagefilltoborder stackoverflow on truecolor images)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$im = imagecreatetruecolor(10, 10);
imagefilltoborder($im, 0, 0, 1, -2);
?>
===DONE===
--EXPECT--
===DONE===
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #73213 (Integer overflow in imageline() with antialiasing)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
$im = imagecreatetruecolor(32768, 1);
$black = imagecolorallocate($im, 0, 0, 0);
imageantialias($im, true);
imageline($im, 0,0, 32767,0, $black);
test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'bug73213.png', $im);
?>
===DONE===
--EXPECT--
The images are equal.
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #73272 (imagescale() is not affected by, but affects imagesetinterpolation())
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
$src = imagecreatetruecolor(100, 100);
imagefilledrectangle($src, 0,0, 99,99, 0xFFFFFF);
imageellipse($src, 49,49, 40,40, 0x000000);
imagesetinterpolation($src, IMG_NEAREST_NEIGHBOUR);
imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
$dst = imagerotate($src, 60, 0xFFFFFF);
test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'bug73272.png', $dst);
?>
===DONE===
--EXPECT--
The images are equal.
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #73279 (Integer overflow in gdImageScaleBilinearPalette())
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.4', '<')) {
die('skip only for bundled libgd or external libgd >= 2.2.4');
}
?>
--FILE--
<?php
$src = imagecreate(100, 100);
imagecolorallocate($src, 255, 255, 255);
$dst = imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
printf("color: %x\n", imagecolorat($dst, 99, 99));
?>
===DONE===
--EXPECT--
color: ffffff
===DONE===
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #73279 (Integer overflow in gdImageScaleBilinearPalette())
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
if (GD_BUNDLED || version_compare(GD_VERSION, '2.2.4', '>=')) {
die('skip only for external libgd < 2.2.4');
}
?>
--FILE--
<?php
$src = imagecreate(100, 100);
imagecolorallocate($src, 255, 255, 255);
$dst = imagescale($src, 200, 200, IMG_BILINEAR_FIXED);
printf("color: %x\n", imagecolorat($dst, 99, 99));
?>
===DONE===
--XFAIL--
Bug #330 has not yet been fixed
--EXPECT--
color: ffffff
===DONE===
+21
View File
@@ -0,0 +1,21 @@
--TEST--
bool hash_update_file ( resource $hcontext , string $filename [, resource $scontext = NULL ] );
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
--SKIPIF--
<?php
if (phpversion() < "5.3.0") {
die('SKIP php version so lower.');
}
require_once(dirname(__FILE__) . '/skip_mhash.inc'); ?>
?>
--FILE--
<?php
$ctx = hash_init('md5');
$filePath = __DIR__ . DIRECTORY_SEPARATOR . 'sha1.phpt';
fopen($filePath, "r");
var_dump(hash_update_file($ctx, $filePath));
hash_final($ctx);
?>
--EXPECT--
bool(true)
+23
View File
@@ -0,0 +1,23 @@
--TEST--
int hash_update_stream ( resource $context , resource $handle [, int $length = -1 ] );
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
--SKIPIF--
<?php
if (phpversion() < "5.3.0") {
die('SKIP php version so lower.');
}
require_once(dirname(__FILE__) . '/skip_mhash.inc'); ?>
?>
--FILE--
<?php
$fp = tmpfile();
fwrite($fp, 'The quick brown fox jumped over the lazy dog.');
rewind($fp);
$ctx = hash_init('md5');
hash_update_stream($ctx, $fp);
echo hash_final($ctx);
?>
--EXPECT--
5c6ffbdd40d9556b73a21e63c3e0e904
+2 -2
View File
@@ -3934,7 +3934,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
char *tsm_errmsg = NULL;
ADDRESS *addr;
char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL, *bufferHeader = NULL;
int offset, bufferLen = 0;
size_t offset, bufferLen = 0;
size_t bt_len;
if (headers) {
@@ -3950,7 +3950,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
#define PHP_IMAP_CLEAN if (bufferTo) efree(bufferTo); if (bufferCc) efree(bufferCc); if (bufferBcc) efree(bufferBcc); if (bufferHeader) efree(bufferHeader);
#define PHP_IMAP_BAD_DEST PHP_IMAP_CLEAN; efree(tempMailTo); return (BAD_MSG_DESTINATION);
bufferHeader = (char *)emalloc(bufferLen + 1);
bufferHeader = (char *)safe_emalloc(bufferLen, 1, 1);
memset(bufferHeader, 0, bufferLen);
if (to && *to) {
strlcat(bufferHeader, "To: ", bufferLen + 1);
+10 -1
View File
@@ -120,7 +120,16 @@ if (PHP_INTL != "no") {
codepointiterator_methods.cpp ",
"intl");
ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib icule.lib iculx.lib");
ADD_FLAG("LIBS_INTL", "icudt.lib icuin.lib icuio.lib");
/* Compat for ICU before 58.1.*/
if (CHECK_LIB("icule.lib", "intl", PHP_INTL)) {
ADD_FLAG("LIBS_INTL", "icule.lib");
}
if (CHECK_LIB("iculx.lib", "intl", PHP_INTL)) {
ADD_FLAG("LIBS_INTL", "iculx.lib");
}
ADD_FLAG("CFLAGS_INTL", "/EHsc");
AC_DEFINE("HAVE_INTL", 1, "Internationalization support enabled");
} else {
+1 -1
View File
@@ -53,7 +53,7 @@ void intl_convert_utf8_to_utf16(
UErrorCode* status )
{
UChar* dst_buf = NULL;
int32_t dst_len = 0;
uint32_t dst_len = 0;
/* If *target is NULL determine required destination buffer size (pre-flighting).
* Otherwise, attempt to convert source string; if *target buffer is not large enough
+21 -1
View File
@@ -268,6 +268,9 @@ static zend_string* get_icu_value_internal( const char* loc_name , char* tag_nam
int32_t buflen = 512;
UErrorCode status = U_ZERO_ERROR;
if (strlen(loc_name) > INTL_MAX_LOCALE_LEN) {
return NULL;
}
if( strcmp(tag_name, LOC_CANONICALIZE_TAG) != 0 ){
/* Handle grandfathered languages */
@@ -405,7 +408,10 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
loc_name_len = strlen(loc_name);
}
INTL_CHECK_LOCALE_LEN(loc_name_len);
/* Call ICU get */
tag_value = get_icu_value_internal( loc_name , tag_name , &result ,0);
@@ -710,6 +716,8 @@ PHP_FUNCTION( locale_get_keywords )
RETURN_FALSE;
}
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
}
@@ -1117,6 +1125,8 @@ PHP_FUNCTION(locale_parse)
RETURN_FALSE;
}
INTL_CHECK_LOCALE_LEN(strlen(loc_name));
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
}
@@ -1167,8 +1177,10 @@ PHP_FUNCTION(locale_get_all_variants)
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
loc_name_len = strlen(loc_name);
}
INTL_CHECK_LOCALE_LEN(loc_name_len);
array_init( return_value );
@@ -1271,12 +1283,16 @@ PHP_FUNCTION(locale_filter_matches)
if(loc_range_len == 0) {
loc_range = intl_locale_get_default();
loc_range_len = strlen(loc_range);
}
if( strcmp(loc_range,"*")==0){
RETURN_TRUE;
}
INTL_CHECK_LOCALE_LEN(loc_range_len);
INTL_CHECK_LOCALE_LEN(lang_tag_len);
if( boolCanonical ){
/* canonicalize loc_range */
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
@@ -1551,13 +1567,17 @@ PHP_FUNCTION(locale_lookup)
if(loc_range_len == 0) {
if(fallback_loc_str) {
loc_range = ZSTR_VAL(fallback_loc_str);
loc_range_len = ZSTR_LEN(fallback_loc_str);
} else {
loc_range = intl_locale_get_default();
loc_range_len = strlen(loc_range);
}
}
hash_arr = Z_ARRVAL_P(arr);
INTL_CHECK_LOCALE_LEN(loc_range_len);
if( !hash_arr || zend_hash_num_elements( hash_arr ) == 0 ) {
RETURN_EMPTY_STRING();
}
@@ -1608,7 +1628,7 @@ PHP_FUNCTION(locale_accept_from_http)
len = end ? end-start : http_accept_len-(start-http_accept);
if(len > ULOC_FULLNAME_CAPACITY) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
"locale_accept_from_http: locale string too long", 0 TSRMLS_CC );
"locale_accept_from_http: locale string too long", 0 );
RETURN_FALSE;
}
if(end) {
+1 -1
View File
@@ -83,7 +83,7 @@ msgformat_data* msgformat_data_create( void )
int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec)
{
if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) {
UChar *npattern = emalloc(sizeof(UChar)*(2*(*spattern_len)+1));
UChar *npattern = safe_emalloc(sizeof(UChar)*2, *spattern_len, sizeof(UChar));
uint32_t npattern_len;
npattern_len = umsg_autoQuoteApostrophe(*spattern, *spattern_len, npattern, 2*(*spattern_len)+1, ec);
efree(*spattern);
@@ -101,6 +101,13 @@ static int resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_constr
locale = intl_locale_get_default();
}
if (bundlename_len >= MAXPATHLEN) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "Bundle name too long", 0 );
zval_dtor(return_value);
ZVAL_NULL(return_value);
return FAILURE;
}
if (fallback) {
rb->me = ures_open(bundlename, locale, &INTL_DATA_ERROR_CODE(rb));
} else {
@@ -331,6 +338,11 @@ PHP_FUNCTION( resourcebundle_locales )
RETURN_FALSE;
}
if (bundlename_len >= MAXPATHLEN) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "resourcebundle_locales: bundle name too long", 0 );
RETURN_FALSE;
}
if(bundlename_len == 0) {
// fetch default locales list
bundlename = NULL;
+1 -3
View File
@@ -9,6 +9,4 @@ $out = locale_get_primary_language($var1);
echo strlen($out) . PHP_EOL;
echo unpack('H*', $out)[1] . PHP_EOL;
--EXPECT--
1000
61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
0
+3 -3
View File
@@ -148,7 +148,7 @@ static PHP_GINIT_FUNCTION(json)
#endif
json_globals->encoder_depth = 0;
json_globals->error_code = 0;
json_globals->encode_max_depth = 0;
json_globals->encode_max_depth = PHP_JSON_PARSER_DEFAULT_DEPTH;
}
/* }}} */
@@ -261,12 +261,12 @@ static PHP_FUNCTION(json_decode)
}
if (depth <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be greater than zero");
php_error_docref(NULL, E_WARNING, "Depth must be greater than zero");
RETURN_NULL();
}
if (depth > INT_MAX) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be lower than %d", INT_MAX);
php_error_docref(NULL, E_WARNING, "Depth must be lower than %d", INT_MAX);
RETURN_NULL();
}
+22 -14
View File
@@ -3766,10 +3766,12 @@ PHP_FUNCTION(mb_convert_variables)
target_hash = HASH_OF(var);
if (target_hash != NULL) {
while ((hash_entry = zend_hash_get_current_data(target_hash)) != NULL) {
if (++target_hash->u.v.nApplyCount > 1) {
--target_hash->u.v.nApplyCount;
recursion_error = 1;
goto detect_end;
if (!Z_IMMUTABLE_P(var)) {
if (++target_hash->u.v.nApplyCount > 1) {
--target_hash->u.v.nApplyCount;
recursion_error = 1;
goto detect_end;
}
}
zend_hash_move_forward(target_hash);
if (Z_TYPE_P(hash_entry) == IS_INDIRECT) {
@@ -3813,15 +3815,17 @@ detect_end:
}
if (recursion_error) {
while(stack_level-- && (var = &stack[stack_level])) {
if (HASH_OF(var)->u.v.nApplyCount > 1) {
HASH_OF(var)->u.v.nApplyCount--;
if (!Z_IMMUTABLE_P(var)) {
if (HASH_OF(var)->u.v.nApplyCount > 1) {
HASH_OF(var)->u.v.nApplyCount--;
}
}
}
efree(stack);
if (elist != NULL) {
efree((void *)elist);
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot handle recursive references");
php_error_docref(NULL, E_WARNING, "Cannot handle recursive references");
RETURN_FALSE;
}
efree(stack);
@@ -3878,10 +3882,12 @@ detect_end:
hash_entry = hash_entry_ptr;
ZVAL_DEREF(hash_entry);
if (Z_TYPE_P(hash_entry) == IS_ARRAY || Z_TYPE_P(hash_entry) == IS_OBJECT) {
if (++(HASH_OF(hash_entry)->u.v.nApplyCount) > 1) {
--(HASH_OF(hash_entry)->u.v.nApplyCount);
recursion_error = 1;
goto conv_end;
if (!Z_IMMUTABLE_P(hash_entry)) {
if (++(HASH_OF(hash_entry)->u.v.nApplyCount) > 1) {
--(HASH_OF(hash_entry)->u.v.nApplyCount);
recursion_error = 1;
goto conv_end;
}
}
if (stack_level >= stack_max) {
stack_max += PHP_MBSTR_STACK_BLOCK_SIZE;
@@ -3929,12 +3935,14 @@ conv_end:
if (recursion_error) {
while(stack_level-- && (var = &stack[stack_level])) {
if (HASH_OF(var)->u.v.nApplyCount > 1) {
HASH_OF(var)->u.v.nApplyCount--;
if (!Z_IMMUTABLE_P(var)) {
if (HASH_OF(var)->u.v.nApplyCount > 1) {
HASH_OF(var)->u.v.nApplyCount--;
}
}
}
efree(stack);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot handle recursive references");
php_error_docref(NULL, E_WARNING, "Cannot handle recursive references");
RETURN_FALSE;
}
efree(stack);
+3 -2
View File
@@ -642,7 +642,7 @@ PHP_FUNCTION(mcrypt_generic)
block_size = mcrypt_enc_get_block_size(pm->td);
data_size = ((((int)data_len - 1) / block_size) + 1) * block_size;
if (data_size <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Integer overflow in data size");
php_error_docref(NULL, E_WARNING, "Integer overflow in data size");
RETURN_FALSE;
}
data_str = zend_string_alloc(data_size, 0);
@@ -696,7 +696,7 @@ PHP_FUNCTION(mdecrypt_generic)
block_size = mcrypt_enc_get_block_size(pm->td);
data_size = ((((int)data_len - 1) / block_size) + 1) * block_size;
if (data_size <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Integer overflow in data size");
php_error_docref(NULL, E_WARNING, "Integer overflow in data size");
RETURN_FALSE;
}
data_s = emalloc((size_t)data_size + 1);
@@ -1299,6 +1299,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, c
}
if (mcrypt_generic_init(td, (void *) key, (int)key_len, (void *) iv) < 0) {
efree(data_s);
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
mcrypt_module_close(td);
RETURN_FALSE;
+5
View File
@@ -1387,6 +1387,11 @@ void php_oci_bind_hash_dtor(zval *data)
{
php_oci_bind *bind = (php_oci_bind *) Z_PTR_P(data);
if (!Z_ISUNDEF(bind->parameter)) {
zval_ptr_dtor(&bind->parameter);
ZVAL_UNDEF(&bind->parameter);
}
if (bind->array.elements) {
efree(bind->array.elements);
bind->array.elements = NULL;
+1 -1
View File
@@ -110,7 +110,7 @@ PHP_FUNCTION(oci_bind_by_name)
zval *bind_var = NULL;
php_oci_statement *statement;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz/|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz|ll", &z_statement, &name, &name_len, &bind_var, &maxlen, &type) == FAILURE) {
return;
}
+38 -23
View File
@@ -1094,13 +1094,20 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
int mode = OCI_DATA_AT_EXEC;
sb4 value_sz = -1;
sword errstatus;
zval *param = NULL;
if (!Z_ISREF_P(var)) {
param = var;
} else {
param = Z_REFVAL_P(var);
}
switch (type) {
case SQLT_NTY:
{
zval *tmp;
if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "collection", sizeof("collection")-1)) == NULL) {
if (Z_TYPE_P(param) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(param), "collection", sizeof("collection")-1)) == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to find collection property");
return 1;
}
@@ -1122,7 +1129,7 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
{
zval *tmp;
if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor")-1)) == NULL) {
if (Z_TYPE_P(param) != IS_OBJECT || (tmp = zend_hash_str_find(Z_OBJPROP_P(param), "descriptor", sizeof("descriptor")-1)) == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
return 1;
}
@@ -1141,17 +1148,17 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
case SQLT_INT:
case SQLT_NUM:
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_long(var);
convert_to_long(param);
#if defined(OCI_MAJOR_VERSION) && (OCI_MAJOR_VERSION > 10) && \
(defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64))
bind_data = (ub8 *)&Z_LVAL_P(var);
bind_data = (ub8 *)&Z_LVAL_P(param);
value_sz = sizeof(ub8);
#else
bind_data = (ub4 *)&Z_LVAL_P(var);
bind_data = (ub4 *)&Z_LVAL_P(param);
value_sz = sizeof(ub4);
#endif
mode = OCI_DEFAULT;
@@ -1162,20 +1169,20 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
case SQLT_LNG:
case SQLT_AFC:
case SQLT_CHR: /* SQLT_CHR is the default value when type was not specified */
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
if (Z_TYPE_P(var) != IS_NULL) {
convert_to_string(var);
if (Z_TYPE_P(param) != IS_NULL) {
convert_to_string(param);
}
if ((maxlength == -1) || (maxlength == 0)) {
if (type == SQLT_LNG) {
value_sz = SB4MAXVAL;
} else if (Z_TYPE_P(var) == IS_STRING) {
value_sz = (sb4) Z_STRLEN_P(var);
} else if (Z_TYPE_P(param) == IS_STRING) {
value_sz = (sb4) Z_STRLEN_P(param);
} else {
/* Bug-72524: revert value_sz from PHP_OCI_PIECE_SIZE to 0. This restores PHP 5.6 behavior */
/* Bug-72524: revert value_sz from PHP_OCI_PIECE_SIZE to 0. This restores PHP 5.6 behavior */
value_sz = 0;
}
} else {
@@ -1184,11 +1191,11 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
break;
case SQLT_RSET:
if (Z_TYPE_P(var) != IS_RESOURCE) {
if (Z_TYPE_P(param) != IS_RESOURCE) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
PHP_OCI_ZVAL_TO_STATEMENT_EX(var, bind_statement);
PHP_OCI_ZVAL_TO_STATEMENT_EX(param, bind_statement);
value_sz = sizeof(void*);
oci_stmt = bind_statement->stmt;
@@ -1200,15 +1207,15 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12
case SQLT_BOL:
if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) {
if (Z_TYPE_P(param) == IS_RESOURCE || Z_TYPE_P(param) == IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
return 1;
}
convert_to_boolean(var);
bind_data = (zend_long *)&Z_LVAL_P(var);
if (Z_TYPE_P(var) == IS_TRUE)
convert_to_boolean(param);
bind_data = (zend_long *)&Z_LVAL_P(param);
if (Z_TYPE_P(param) == IS_TRUE)
*(zend_long *)bind_data = 1;
else if (Z_TYPE_P(var) == IS_FALSE)
else if (Z_TYPE_P(param) == IS_FALSE)
*(zend_long *)bind_data = 0;
else {
php_error_docref(NULL, E_WARNING, "Invalid variable used for bind");
@@ -1234,6 +1241,10 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
if ((old_bind = zend_hash_str_find_ptr(statement->binds, name, name_len)) != NULL) {
bindp = old_bind;
if (!Z_ISUNDEF(bindp->parameter)) {
zval_ptr_dtor(&bindp->parameter);
ZVAL_UNDEF(&bindp->parameter);
}
} else {
zend_string *zvtmp;
zvtmp = zend_string_init(name, name_len, 0);
@@ -1241,16 +1252,20 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, size_t name_l
bindp = zend_hash_update_ptr(statement->binds, zvtmp, bindp);
zend_string_release(zvtmp);
}
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
* when both in/out parameters are bound with empty strings
*/
/* Keep a copy of bound variable in the bind hash */
ZVAL_COPY(&bindp->parameter, var);
/* Make sure the minimum of value_sz is 1 to avoid ORA-3149
* when both in/out parameters are bound with empty strings
*/
if (value_sz == 0)
value_sz = 1;
bindp->descriptor = oci_desc;
bindp->statement = oci_stmt;
bindp->parent_statement = statement;
bindp->zval = var;
bindp->zval = param;
bindp->type = type;
/* Storing max length set in OCIBindByName() to check it later in
* php_oci_bind_in_callback() function to avoid ORA-1406 error while
+21 -5
View File
@@ -46,12 +46,12 @@ Interoperability Support" (ID 207303.1) for details.
<active>no</active>
</lead>
<date>2016-08-18</date>
<date>2016-10-17</date>
<time>12:00:00</time>
<version>
<release>2.1.2</release>
<api>2.1.2</api>
<release>2.1.3</release>
<api>2.1.3</api>
</version>
<stability>
<release>stable</release>
@@ -60,8 +60,7 @@ Interoperability Support" (ID 207303.1) for details.
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Fixed invalid handle error with Implicit Result Sets
Fixed bug #72524 (Binding null values triggers ORA-24816 error)
Fixed bug #71148 (Bind reference overwritten on PHP 7)
</notes>
<contents>
<dir name="/">
@@ -469,6 +468,23 @@ Fixed bug #72524 (Binding null values triggers ORA-24816 error)
</extsrcrelease>
<changelog>
<release>
<version>
<release>2.1.2</release>
<api>2.1.2</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Fixed invalid handle error with Implicit Result Sets
Fixed bug #72524 (Binding null values triggers ORA-24816 error)
</notes>
</release>
<release>
<version>
<release>2.1.1</release>
+1 -1
View File
@@ -43,7 +43,7 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.2"
#define PHP_OCI8_VERSION "2.1.3"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
+1
View File
@@ -243,6 +243,7 @@ typedef struct {
typedef struct {
OCIBind *bind; /* bind handle */
zval *zval; /* value */
zval parameter; /* a copy of bound variable used for oci_bind_by_name */
dvoid *descriptor; /* used for binding of LOBS etc */
OCIStmt *statement; /* used for binding REFCURSORs */
php_oci_statement *parent_statement; /* pointer to the parent statement */
+191
View File
@@ -0,0 +1,191 @@
--TEST--
Bug #71448 (Binding reference overwritten on php7)
--SKIPIF--
<?php
$target_dbs = array('oracledb' => true, 'timesten' => true); // test runs on these DBs
require(dirname(__FILE__).'/skipif.inc');
?>
--FILE--
<?php
require(dirname(__FILE__).'/connect.inc');
// Initialize
$stmtarray = array(
"CREATE OR REPLACE FUNCTION bindfunc(var1 varchar2, var2 varchar2)
RETURN varchar2
AS var3 VARCHAR2(20);
BEGIN
var3 := CONCAT(var1, var2);
RETURN var3;
END;",
"CREATE OR REPLACE PROCEDURE bindproc(var1 IN string, var2 IN string, var3 IN OUT string) IS
BEGIN
var3 := CONCAT(var1, var3);
var3 := CONCAT(var3, var2);
END;"
);
oci8_test_sql_execute($c, $stmtarray);
// Run test
function bindvar($stmt, $name, $var)
{
oci_bind_by_name($stmt, $name, $var);
}
// Test 1: Bind input parameter in a local function
$sql = "select :var1, :var2 from dual";
$cache1 = "INSTR1";
$cache2 = "INSTR2";
echo "Test 1: Bind input parameter in a local function\n";
$stmt = oci_parse($c, $sql);
bindvar($stmt, ':var1', $cache1);
bindvar($stmt, ':var2', $cache2);
oci_execute($stmt);
var_dump(oci_fetch_assoc($stmt));
oci_free_statement($stmt);
// Test 2: Bind output parameter in a local function
$sql = "begin :output1 := 'OUTSTR1'; :output2 := 'OUTSTR2'; end;";
$cache1 = "xxxxxx";
$cache2 = "xxxxxx";
echo "\nTest 2: Bind output parameter in a local function\n";
$stmt = oci_parse($c, $sql);
bindvar($stmt, ':output1', $cache1);
bindvar($stmt, ':output2', $cache2);
oci_execute($stmt);
var_dump($cache1);
var_dump($cache2);
oci_free_statement($stmt);
// Test 3: Bind output parameter within the same scope of execute
$sql = "begin :output1 := 'OUTSTR1'; :output2 := 'OUTSTR2'; end;";
$cache1 = "xxxxxx";
$cache2 = "xxxxxx";
echo "\nTest 3: Bind output parameter within the same scope of execute\n";
$stmt = oci_parse($c, $sql);
oci_bind_by_name($stmt, ":output1", $cache1);
oci_bind_by_name($stmt, ":output2", $cache2);
oci_execute($stmt);
var_dump($cache1);
var_dump($cache2);
oci_free_statement($stmt);
// Test 4: Bind output parameter within the same scope of execute
$sql= "begin :output := bindfunc(:var1, :var2); end;";
$cache1 = "STR1";
$cache2 = "STR2";
echo "\nTest 4: Bind output parameter within the same scope of execute\n";
$stmt = oci_parse($c, $sql);
oci_bind_by_name($stmt, ":var1", $cache1, -1);
oci_bind_by_name($stmt, ":var2", $cache2, -1);
oci_bind_by_name($stmt, ":output", $cache3, 100);
oci_execute($stmt);
var_dump($cache3);
// Test 5: Bind IN OUT parameter in a local function
$sql = "call bindproc(:var1, :var2, :var3)";
$cache1 = 'STR1';
$cache2 = 'STR2';
$cache3 = ' ';
echo "\nTest 5: Bind IN OUT parameter in a local function\n";
$stmt = oci_parse($c, $sql);
bindvar($stmt, ':var1', $cache1);
bindvar($stmt, ':var2', $cache2);
bindvar($stmt, ':var3', $cache3);
oci_execute($stmt);
var_dump($cache1);
var_dump($cache2);
var_dump($cache3);
oci_free_statement($stmt);
// Test 6: Bind IN OUT parameter within the same scope of execute
$sql = "call bindproc(:var1, :var2, :var3)";
$cache1 = 'STR1';
$cache2 = 'STR2';
$cache3 = ' ';
echo "\nTest 6: Bind IN OUT parameter within the same scope of execute\n";
$stmt = oci_parse($c, $sql);
oci_bind_by_name($stmt, ":var1", $cache1, -1);
oci_bind_by_name($stmt, ":var2", $cache2, -1);
oci_bind_by_name($stmt, ":var3", $cache3, 100);
oci_execute($stmt);
var_dump($cache1);
var_dump($cache2);
var_dump($cache3);
// Cleanup
$stmtarray = array(
"DROP FUNCTION bindfunc",
"DROP PROCEDURE bindproc"
);
oci8_test_sql_execute($c, $stmtarray);
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
Test 1: Bind input parameter in a local function
array(2) {
[":VAR1"]=>
string(6) "INSTR1"
[":VAR2"]=>
string(6) "INSTR2"
}
Test 2: Bind output parameter in a local function
string(6) "xxxxxx"
string(6) "xxxxxx"
Test 3: Bind output parameter within the same scope of execute
string(7) "OUTSTR1"
string(7) "OUTSTR2"
Test 4: Bind output parameter within the same scope of execute
string(8) "STR1STR2"
Test 5: Bind IN OUT parameter in a local function
string(4) "STR1"
string(4) "STR2"
string(1) " "
Test 6: Bind IN OUT parameter within the same scope of execute
string(4) "STR1"
string(4) "STR2"
string(9) "STR1 STR2"
===DONE===
+3 -3
View File
@@ -57,11 +57,11 @@ function get_attr($conn)
?>
--EXPECT--
**Test 1.1 - Default values for the attribute **************
The value of DRIVER_NAME is PHP OCI8 : 2.1.2
The value of DRIVER_NAME is PHP OCI8 : 2.1.3
***Test 1.2 - Get the values from different connections **************
Testing with oci_pconnect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.2
The value of DRIVER_NAME is PHP OCI8 : 2.1.3
Testing with oci_new_connect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.2
The value of DRIVER_NAME is PHP OCI8 : 2.1.3
Done
+15 -26
View File
@@ -876,9 +876,7 @@ PHP_MINFO_FUNCTION(odbc)
/* {{{ odbc_sql_error */
void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
{
char state[6];
SQLINTEGER error; /* Not used */
char errormsg[SQL_MAX_MESSAGE_LENGTH];
SQLSMALLINT errormsgsize; /* Not used */
RETCODE rc;
ODBC_SQL_ENV_T henv;
@@ -897,21 +895,19 @@ void odbc_sql_error(ODBC_SQL_ERROR_PARAMS)
while(henv != SQL_NULL_HENV){
do {
*/
rc = SQLError(henv, conn, stmt, state, &error, errormsg, sizeof(errormsg)-1, &errormsgsize);
rc = SQLError(henv, conn, stmt, ODBCG(laststate), &error, ODBCG(lasterrormsg), sizeof(ODBCG(lasterrormsg))-1, &errormsgsize);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
snprintf(state, sizeof(state), "HY000");
snprintf(errormsg, sizeof(errormsg), "Failed to fetch error message");
snprintf(ODBCG(laststate), sizeof(ODBCG(laststate)), "HY000");
snprintf(ODBCG(lasterrormsg), sizeof(ODBCG(lasterrormsg)), "Failed to fetch error message");
}
if (conn_resource) {
memcpy(conn_resource->laststate, state, sizeof(state));
memcpy(conn_resource->lasterrormsg, errormsg, sizeof(errormsg));
memcpy(conn_resource->laststate, ODBCG(laststate), sizeof(ODBCG(laststate)));
memcpy(conn_resource->lasterrormsg, ODBCG(lasterrormsg), sizeof(ODBCG(lasterrormsg)));
}
memcpy(ODBCG(laststate), state, sizeof(state));
memcpy(ODBCG(lasterrormsg), errormsg, sizeof(errormsg));
if (func) {
php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func);
php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s in %s", ODBCG(lasterrormsg), ODBCG(laststate), func);
} else {
php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s", errormsg, state);
php_error_docref(NULL, E_WARNING, "SQL error: %s, SQL state %s", ODBCG(lasterrormsg), ODBCG(laststate));
}
/*
} while (SQL_SUCCEEDED(rc));
@@ -2442,6 +2438,7 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
RETCODE rc;
*conn = (odbc_connection *)pemalloc(sizeof(odbc_connection), persistent);
memset(*conn, 0, sizeof(odbc_connection));
(*conn)->persistent = persistent;
SQLAllocEnv(&((*conn)->henv));
SQLAllocConnect((*conn)->henv, &((*conn)->hdbc));
@@ -3047,38 +3044,30 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
odbc_connection *conn;
zval *pv_handle;
zend_string *ptr;
int len;
char *ret;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &pv_handle) == FAILURE) {
return;
}
if (mode == 0) { /* last state */
len = 6;
} else { /* last error message */
len = SQL_MAX_MESSAGE_LENGTH;
}
if (ZEND_NUM_ARGS() == 1) {
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_handle), "ODBC-Link", le_conn, le_pconn))) {
RETURN_FALSE;
}
ptr = zend_string_alloc(len + 1, 0);
if (mode == 0) {
strlcpy(ZSTR_VAL(ptr), conn->laststate, len+1);
ret = conn->laststate;
} else {
strlcpy(ZSTR_VAL(ptr), conn->lasterrormsg, len+1);
ret = conn->lasterrormsg;
}
} else {
ptr = zend_string_alloc(len, 0);
if (mode == 0) {
strlcpy(ZSTR_VAL(ptr), ODBCG(laststate), len+1);
ret = ODBCG(laststate);
} else {
strlcpy(ZSTR_VAL(ptr), ODBCG(lasterrormsg), len+1);
ret = ODBCG(lasterrormsg);
}
}
RETVAL_STR(ptr);
RETURN_STRING(ret);
}
/* }}} */
+52
View File
@@ -0,0 +1,52 @@
--TEST--
Bug #73448 odbc_errormsg returns trash, always 513 bytes
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
include 'config.inc';
$conn = odbc_connect($dsn, $user, $pass);
$sqlCommandList = array(
"/* empty batch is without error */",
"/* non existent procedure xy */ execute xy",
"/* empty batch,error message is not empty */",
"/* valid select with result */ select * from sys.sysobjects",
"/* another erroneous query */ SELECT * FROM zwiebelfleisch",
"/* valid select with result */ select * from sys.sysobjects",
);
foreach ($sqlCommandList as $exampleNumber => $sql) {
$r = @odbc_exec($conn, $sql);
if (false === $r) {
$e = odbc_errormsg($conn);
$n = odbc_error($conn);
var_dump($sql, $n, $e, strlen($e));
echo "\n";
}
if ($r) {
odbc_free_result($r);
}
}
odbc_close($conn);
?>
==DONE==
--EXPECT--
string(42) "/* non existent procedure xy */ execute xy"
string(5) "37000"
string(84) "[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'xy'."
int(84)
string(58) "/* another erroneous query */ SELECT * FROM zwiebelfleisch"
string(5) "S0002"
string(84) "[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'zwiebelfleisch'."
int(84)
==DONE==
Loaded 100 of 252 files, more files were not shown because too many files have changed in this diff. Show more