Compare commits

..
Author SHA1 Message Date
Davey Shafik 05fe5b4904 Update versions/dates for PHP 7.1.0RC1 2016-08-31 16:17:02 +00:00
Christoph M. Becker 9cc11dbded Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 16:45:15 +02:00
Christoph M. Becker f93fd8ce32 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 16:38:38 +02:00
Christoph M. Becker b2d267d9ee Fix #71882 amendment 2: Negative ftruncate() on php://memory exhausts memory 2016-08-31 16:33:14 +02:00
Christoph M. Becker cb78ea9cc3 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 14:55:37 +02:00
Christoph M. Becker 8f32d609c5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 14:53:53 +02:00
Christoph M. Becker 314a9f8553 Fix #71882 amendment: Negative ftruncate() on php://memory exhausts memory
To avoid BC breaks, we do not raise a warning for now.
2016-08-31 14:51:37 +02:00
Christoph M. Becker 56ed966bc6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 14:32:24 +02:00
Yasuo Ohgaki 97f2bb894a Update NEWS 2016-08-31 21:10:57 +09:00
Yasuo Ohgaki e385b05ebe Update NEWS 2016-08-31 21:08:23 +09:00
Yasuo Ohgaki 747b61808b Update NEWS 2016-08-31 21:06:19 +09:00
Yasuo Ohgaki aff4c7d826 Add tests 2016-08-31 21:03:10 +09:00
Yasuo Ohgaki 7ee9f81c54 Merge RFC https://wiki.php.net/rfc/session-create-id 2016-08-31 20:34:20 +09:00
Christoph M. Becker 08a71df612 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 13:27:23 +02:00
Christoph M. Becker f215fb874f Fix #71882 amendment: Negative ftruncate() on php://memory exhausts memory
To avoid BC breaks, we do not raise a warning for now.
2016-08-31 13:24:37 +02:00
Anatol Belski aeb7b4094a sync tests 2016-08-31 12:26:51 +02:00
Anatol Belski e446ec14e5 add more defs for resource alloc/dealloc 2016-08-31 12:10:40 +02:00
Anatol Belski 4c8e6a2c95 add yet one define 2016-08-31 12:10:40 +02:00
Davey Shafik 11f0f97160 Update NEWS 2016-08-30 19:47:50 -07:00
Davey Shafik 12ee17d5e0 Implement \ArgumentCountError exception 2016-08-30 19:35:56 -07:00
Nikita Popov 02fb46e17c Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 18:07:21 +02:00
Nikita Popov 3317287ce1 Fix bug #71711
Also handle another case of bug #71996.
2016-08-30 18:06:18 +02:00
Nikita Popov b218eb916f Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 17:21:33 +02:00
Nikita Popov 8e487aefaa Fixed bug #71996 2016-08-30 17:20:55 +02:00
Christoph M. Becker ecdef60d00 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 15:12:49 +02:00
Christoph M. Becker 972302d2f0 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 15:01:12 +02:00
Christoph M. Becker 2f10db36af Fix #66797: mb_substr only takes 32-bit signed integer
`from` and `len` are `long`, but get passed to mbfl_substr() which expects
`int`s. Therefore we clamp the values to avoid the undefined conversion
behavior.
2016-08-30 14:52:47 +02:00
Anatol Belski 3d66d56c1d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix typo
  prepare for next
2016-08-30 14:16:48 +02:00
Anatol Belski 52afd8b744 fix typo 2016-08-30 14:11:47 +02:00
Anatol Belski bc7460260b prepare for next 2016-08-30 14:11:22 +02:00
Nikita Popov c361020f04 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 13:45:49 +02:00
Nikita Popov 2c12a5f0a8 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 13:44:59 +02:00
Ville Hukkamäki af7828a20f Test case for bug #72771 2016-08-30 13:44:34 +02:00
Nikita Popov d49024c6de Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 13:06:32 +02:00
Nikita Popov bfd4277008 Fix bug #72957 2016-08-30 13:05:53 +02:00
Nikita Popov 6adb7e0b7a Followup for bug #72971
Property writes did not respect the namespace either. This is an
incomplete fix in that it only handles the case where an existing
child element is modified, not when a new one is created.
2016-08-30 12:53:50 +02:00
Nikita Popov 51a564e505 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 10:56:06 +02:00
Nikita Popov 07cc6a6ba2 Fix bug #72971 2016-08-30 10:54:31 +02:00
Yasuo Ohgaki 4a12450de2 Update NEWS 2016-08-30 16:05:49 +09:00
Yasuo Ohgaki f5cd6e5710 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72940 SID always return "name=ID", even if session cookie exist
2016-08-30 15:58:55 +09:00
Yasuo Ohgaki b5f2f6fbd8 Fixed bug #72940 SID always return "name=ID", even if session cookie exist 2016-08-30 15:58:25 +09:00
Christoph M. Becker 38a7c0e0f7 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 02:24:43 +02:00
Christoph M. Becker 65f0c163f9 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 02:13:48 +02:00
Christoph M. Becker 207dab585a Fix #71882: Negative ftruncate() on php://memory exhausts memory
We must not pass negative sizes to a size_t parameter.
2016-08-30 02:05:45 +02:00
Christoph M. Becker ec8bbba9c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 01:18:59 +02:00
Christoph M. Becker 4b45c0a9a7 Merge branch 'pull-request/2043' into PHP-7.0 2016-08-30 01:16:45 +02:00
Anatol Belski 2bfe926eb1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix HANDLE leak
2016-08-29 21:48:50 +02:00
Anatol Belski 1b227de970 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix HANDLE leak
2016-08-29 21:47:54 +02:00
Anatol Belski c7b4cd1a51 fix HANDLE leak 2016-08-29 21:45:39 +02:00
Anatol Belski 6bb5b6e8a3 update NEWS 2016-08-29 21:26:13 +02:00
Anatol Belski 2b9670512b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
2016-08-29 21:24:08 +02:00
Anatol Belski 5bcae9d586 update NEWS 2016-08-29 21:23:20 +02:00
Anatol Belski b6b7696114 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-08-29 21:22:43 +02:00
Anatol Belski ae81e8fc32 update NEWS 2016-08-29 21:20:36 +02:00
Anatol Belski c560678c14 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  ensure null termination
2016-08-29 21:15:55 +02:00
Anatol Belski 2004585d03 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  ensure null termination
2016-08-29 21:13:39 +02:00
Anatol Belski d787b0ea13 ensure null termination 2016-08-29 21:03:03 +02:00
Anatol Belski 22a825db85 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify
2016-08-29 20:34:44 +02:00
Anatol Belski 946335ba70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify
2016-08-29 20:32:55 +02:00
Anatol Belski 295303b590 Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify 2016-08-29 20:25:34 +02:00
Dmitry Stogov 722783c2c6 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:php-src:
  fix double free
2016-08-29 20:37:01 +03:00
Dmitry Stogov 94fbcbe172 Allow optional splitting of basic blocks at RECV/RECV_INIT opcodes. 2016-08-29 20:35:17 +03:00
Anatol Belski a349afd26b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix double free
2016-08-29 19:34:19 +02:00
Anatol Belski 3437dbfa00 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix double free
2016-08-29 19:33:22 +02:00
Anatol Belski 1a840b9af0 fix double free 2016-08-29 19:27:47 +02:00
Anatol Belski 5c8aa478da Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix double free
2016-08-29 18:57:50 +02:00
Anatol Belski 1d93086937 fix double free 2016-08-29 18:56:25 +02:00
Anatol Belski 3196ea195b add note to UPGRADING.INTERNALS 2016-08-29 18:37:35 +02:00
Anatol Belski 78401a7f01 extend help message 2016-08-29 18:25:00 +02:00
Anatol Belski 78c15e2744 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-29 18:08:17 +02:00
Anatol Belski ca4eeedd36 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-08-29 18:05:47 +02:00
Anatol Belski e2609a38d9 fix leak 2016-08-29 18:01:21 +02:00
Anatol Belski faccbeb588 fix search path 2016-08-29 17:44:37 +02:00
Anatol Belski 3ab2a58753 support also cppcheck for static analyze 2016-08-29 17:44:37 +02:00
Anatol Belski 201f90a8cc add error check and fix leak 2016-08-29 17:25:46 +02:00
Anatol Belski 7ecfb4b954 fix leak 2016-08-29 17:25:13 +02:00
Jakub Zelenka c4961fa8b6 Bump PHP_JSON_VERSION to 1.5.0 2016-08-29 15:18:00 +01:00
Jakub Zelenka ab65665a0e Merge branch 'json_encode_fail_return' into PHP-7.1 2016-08-29 15:01:00 +01:00
Jakub Zelenka f5b4aae7ac Update NEWS with info about a json_encode fail return 2016-08-29 14:59:44 +01:00
Jakub Zelenka 27acbcf4df Add test for fixed bug #68992 2016-08-29 14:49:40 +01:00
Jakub Zelenka df05dbb3df Fix recursion and protection in the failed JSON encoding 2016-08-29 14:49:40 +01:00
Jakub Zelenka 12a8c3f6e7 Add initial failure checking for json_encode 2016-08-29 14:49:40 +01:00
Anatol Belski 50c5d13d26 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-29 15:44:13 +02:00
Anatol Belski d80a317c0b fix leak 2016-08-29 15:43:10 +02:00
Anatol Belski a747578497 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix possible memory leak
2016-08-29 15:29:52 +02:00
Anatol Belski 1d7ec685c1 fix possible memory leak 2016-08-29 15:28:09 +02:00
Anatol Belski 0e709fe42d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix dealloc mismatch
2016-08-29 13:43:08 +02:00
Anatol Belski eac7f4b670 fix dealloc mismatch 2016-08-29 12:46:23 +02:00
Dmitry Stogov b5bab0fce8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72944 (Null pointer deref in zval_delref_p).
2016-08-29 12:07:54 +03:00
Dmitry Stogov b66039db33 Fixed bug #72944 (Null pointer deref in zval_delref_p). 2016-08-29 12:02:50 +03:00
George Wang 0a09eecfcc code cleanup. 2016-08-28 22:31:08 -04:00
George Wang 413bd261ec Merge branch 'PHP-7.0' into PHP-7.1 2016-08-28 22:29:38 -04:00
George Wang ca1eb585ee Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	sapi/litespeed/lsapi_main.c
2016-08-28 22:23:28 -04:00
George Wang c73bcbefbd Added .user.ini support.
Added LSPHPRC support.
update LiteSpeed SAPI version to 6.10 .
2016-08-28 21:49:30 -04:00
Yasuo Ohgaki 1cf179e415 Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc 2016-08-29 05:57:37 +09:00
Anatol Belski be0958d291 extend help msg 2016-08-28 20:18:11 +02:00
Anatol Belski b415290c92 fix leak 2016-08-28 19:42:41 +02:00
Anatol Belski 48b1cb2f12 extend clang vs compat options 2016-08-28 19:42:41 +02:00
Anatol Belski 378ed99424 fix leak 2016-08-28 19:42:41 +02:00
Anatol Belski 10c2ac8c81 integrate clang analyzer 2016-08-28 19:42:41 +02:00
Xinchen Hui 01701912c7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72936 (Zend API's zend_symtable_str_update() asserts key should end with '\0')
2016-08-29 00:10:57 +08:00
Xinchen Hui 986d0f87ec Fixed bug #72936 (Zend API's zend_symtable_str_update() asserts key should end with '\0') 2016-08-29 00:10:31 +08:00
Anatol Belski 92a60a67cf fix leak 2016-08-27 22:28:13 +02:00
Anatol Belski b6440a74c1 add parentheses 2016-08-27 22:26:18 +02:00
Anatol Belski 8a8a441972 fix clang compat 2016-08-27 22:25:02 +02:00
Anatol Belski d58202853d fix leak 2016-08-27 22:24:24 +02:00
Christoph M. Becker 3a78530b8a Merge branch 'PHP-7.0' into PHP-7.1 2016-08-27 01:23:36 +02:00
Christoph M. Becker 8fcfacf746 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-27 01:18:10 +02:00
Christoph M. Becker 2139918ea6 Fix #65550: get_browser() incorrectly parsers entries with "+" sign
+ signs in the browscap patterns are meant to be literal characters, so we
have to escape them for the regex matching.
2016-08-27 01:12:01 +02:00
Anatol Belski 88f6706656 fix leak 2016-08-26 22:05:06 +02:00
Christoph M. Becker 14cd14ddaf Merge branch 'PHP-7.0' into PHP-7.1 2016-08-26 18:52:06 +02:00
Christoph M. Becker c4c3eb55a7 Fix #72949: Typo in opcache error message 2016-08-26 18:50:30 +02:00
Xinchen Hui 557f1ccf0c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72943 (assign_dim on string doesn't reset hval)

Conflicts:
	Zend/zend_execute.c
2016-08-26 18:32:54 +08:00
Xinchen Hui c67fa3c91d Fixed bug #72943 (assign_dim on string doesn't reset hval) 2016-08-26 18:30:08 +08:00
Anatol Belski 726e3b8ff0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  pdo_dblib: stringify uniqidentifier field
2016-08-25 19:46:01 +02:00
Anatol Belski 9f6d2c05b4 update NEWS 2016-08-25 19:44:55 +02:00
Anatol Belski 57509fb969 update NEWS 2016-08-25 19:43:39 +02:00
Alexander Zhuravlev a000bff2c3 pdo_dblib: stringify uniqidentifier field
Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

pdo_dblib: Stringify uniqidentifier field

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

Tests added.

pdo_dblib: Stringify uniqidentifier field

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

Tests fix.

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

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

Simplify storage of stringify_uniqueidentifier attribute
2016-08-25 19:37:21 +02:00
Christoph M. Becker 3f53814ca7 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-25 18:41:45 +02:00
Christoph M. Becker 433976f931 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-25 18:29:23 +02:00
Christoph M. Becker 84512a1177 Fix #70825: Cannot fetch multiple values with group in ini file
If we have the position already from the last fetch, we also have to preset
the current group, because it won't be read again.
2016-08-25 18:18:10 +02:00
Anatol Belski 9f0f7c0336 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix check for args by ref
2016-08-25 18:09:37 +02:00
Anatol Belski 51d19c12a5 fix check for args by ref 2016-08-25 18:06:47 +02:00
Christoph M. Becker 96ea8de591 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-25 16:31:03 +02:00
Christoph M. Becker 5f6a1d1472 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-25 16:22:57 +02:00
Christoph M. Becker bd8112afe0 Fix #71514: Bad dba_replace condition because of wrong API usage
We're backporting commit 9e309a2d to PHP-5.6, because it is a bugfix.
2016-08-25 16:20:30 +02:00
Anatol Belski 2e1bb5ee22 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  backport relevant part from bug #72858 patch in 7.0
2016-08-25 12:53:37 +02:00
Anatol Belski d3058a69d8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport relevant part from bug #72858 patch in 7.0
2016-08-25 12:52:29 +02:00
Anatol Belski a1ff39ffe5 backport relevant part from bug #72858 patch in 7.0 2016-08-25 12:46:28 +02:00
Anatol Belski cd5cab6288 update NEWS 2016-08-25 12:14:33 +02:00
Anatol Belski fe4fa1fadf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72922 COM called from PHP does not return out parameters
2016-08-25 12:13:55 +02:00
Anatol Belski 392c5ea472 Fixed bug #72922 COM called from PHP does not return out parameters 2016-08-25 12:12:45 +02:00
Xinchen Hui 38f7d595c0 Remove redundant \t 2016-08-25 13:29:22 +08:00
Levi Morrison f4e68a3968 Revert "Do not prepend ? on nullables in ReflectionType::__toString()"
This reverts commit 8855a2ce76.
2016-08-23 09:43:31 -06:00
Dmitry Stogov 129e8dadf4 op_arrays may be optimized independetly and "script" might be NULL 2016-08-23 13:17:53 +03:00
Dmitry Stogov 76707dc204 Don't keep dangling pointers. 2016-08-23 12:58:46 +03:00
Dmitry Stogov 62ab40bc96 Added tests and NEWS entry
Fixed bug #72598 (Reference is lost after array_slice())
2016-08-23 12:14:31 +03:00
Dmitry Stogov 0cc8ff2b41 Run ext/opcache/tests/*.phpt by default 2016-08-23 11:51:08 +03:00
Nikita Popov 906456c410 call_user_func(_array): Don't abort on reference warning
Change zend_call_function() to not abort the call if a non-reference
is passed to a reference argument. The usual warning will still be
thrown, but the call will proceed as usual.
2016-08-23 10:29:15 +03:00
Xinchen Hui 26d74a0420 Fixed tests 2016-08-23 11:32:21 +08:00
Xinchen Hui 434ae90e85 Fixed bug #72920 (Accessing a private constant using constant() creates an exception AND warning) 2016-08-22 23:44:38 +08:00
Dmitry Stogov caf890b291 Fixed CFG construction for stackless execution (split basic blocks after calls) 2016-08-22 16:48:26 +03:00
Yasuo Ohgaki 7d703a0060 Adjust test so that it passes on more restrictive filesystems 2016-08-22 17:01:07 +09:00
Jakub Zelenka 21c72827c7 Do not expect error 0407006A in openssl_private_(en|de)crypt
It makes the test work with OpenSSL 1.1
2016-08-21 20:29:03 +01:00
Christoph M. Becker 5347246f56 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-21 19:55:09 +02:00
Christoph M. Becker 4c13a7f5c4 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 19:48:38 +02:00
Christoph M. Becker 6a232c3604 Fix #68716: possible resource leaks in _php_image_convert()
We properly clean up after ourselves wrt. to closing opened file pointers
and created images.
2016-08-21 19:39:58 +02:00
Anatol Belski 096b0a556c extend readdir utf-8 name test 2016-08-21 18:21:49 +02:00
Christoph M. Becker 3dc6c4b329 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-21 17:51:53 +02:00
Christoph M. Becker 4c68fc5392 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 17:45:49 +02:00
Christoph M. Becker d65adac2be Fix #72913: imagecopy() loses single-color transparency on palette images
The proper code to handle true-color to palette copies is already contained
in gdImageCopy(), so we can simply remove the buggy duplicated code.
2016-08-21 17:39:23 +02:00
Christoph M. Becker 15f1b04198 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-21 16:21:13 +02:00
Christoph M. Becker 7a36056d6c Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 16:15:22 +02:00
Christoph M. Becker 9eb5bbd8bd Fix #66005: imagecopy does not support 1bit transparency on truecolor images
We must not copy transparent pixels, see
<https://github.com/libgd/libgd/commit/daac285c>.
2016-08-21 16:08:57 +02:00
Xinchen Hui e849e65d89 This is unecessary for 7.1 (IS_ERROR is an internal type) 2016-08-21 17:40:10 +08:00
Xinchen Hui e572035ecf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug  #72911 (Memleak in zend_binary_assign_op_obj_helper)
  Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260))
2016-08-21 17:39:52 +08:00
Xinchen Hui 0476bb1de5 Fixed bug #72911 (Memleak in zend_binary_assign_op_obj_helper) 2016-08-21 17:38:03 +08:00
Xinchen Hui 17e8a3df13 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260))
2016-08-21 17:19:36 +08:00
Xinchen Hui 226e21b0fe Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:/php-src:
  Improvements to fix #72714, suggested by nikic
  Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
  Fix #72714: _xml_startElementHandler() segmentation fault
  update NEWS
  Fixed bug #72852 imap_mail null dereference
  Revert "Fix dba configuration for Windows"
  Fix dba configuration for Windows
  Fix broken test include
  fix NEWS
  Add myself as PDO_OCI maintainer
2016-08-21 17:19:24 +08:00
Xinchen Hui b740bb3987 Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260)) 2016-08-21 17:10:10 +08:00
Aaron Piotrowski 8855a2ce76 Do not prepend ? on nullables in ReflectionType::__toString()
Better BC with 7.0.
2016-08-21 00:12:47 -05:00
Aaron Piotrowski 08c5d77027 Revert "Fix closure tests using ReflectionType::__toString()"
This reverts commit 6fcedc96fb.
2016-08-20 23:26:01 -05:00
Aaron Piotrowski c9ee0cb202 Revert "Append \ to class name returned from ReflectionType::__toString()"
This reverts commit 20fdd47921.
2016-08-20 23:26:01 -05:00
Anatol Belski 872028de20 fix TS issues with url rewrite globals 2016-08-20 22:41:06 +02:00
Nikita Popov dfed09afca Fix off-by-one in ReflectionType::__toString()
Review mistake...
2016-08-20 19:00:03 +02:00
Christoph M. Becker 9988863d37 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 12:50:48 +02:00
Christoph M. Becker 39172d44d8 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 12:46:08 +02:00
Christoph M. Becker 52793c14d9 Improvements to fix #72714, suggested by nikic 2016-08-20 12:44:20 +02:00
Christoph M. Becker 29849e5ba1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 03:11:05 +02:00
Christoph M. Becker 078f674212 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 03:04:08 +02:00
Christoph M. Becker e4a006cd3e Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
According to the Unicode specification (at least as of 5.1), CRLF sequences
are considered to be a single grapheme. We cater to that special case by
letting grapheme_ascii_check() fail. While it would be trivial to fix
grapheme_ascii_check() wrt. grapheme_strlen(), grapheme_substr() and
grapheme_strrpos() would be much harder to handle, so we accept the slight
performance penalty if CRLF is involved.
2016-08-20 03:01:35 +02:00
Christoph M. Becker 76c796fb27 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 02:28:18 +02:00
Christoph M. Becker db1ef5cb00 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 02:14:49 +02:00
Christoph M. Becker 9164dc11e2 Fix #72714: _xml_startElementHandler() segmentation fault
The issue is caused by an integer overflow when the `long` passed as
XML_OPTION_SKIP_TAGSTART is assigned to `xml_parser::toffset` which is
declared as `int`. We can simply work around this issue, by clipping
resulting negative values to 0 (and raising a notice in this case), because
the reasonable range for this value is certainly catered to by positive
`int`s.

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

After a discussion with Anatol it seems to be better QA wise to not make
this change in stable versions or betas.
2016-08-19 16:35:31 +02:00
Anatol Belski 83255b1e8c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Improve fix for bug #72837
2016-08-19 12:52:13 +02:00
Anatol Belski 2d123a916d Improve fix for bug #72837 2016-08-19 12:50:32 +02:00
Christoph M. Becker 9fcee1e656 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-19 11:49:07 +02:00
Christoph M. Becker 4df85466b6 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-19 11:47:42 +02:00
Christoph M. Becker ad76e8a529 Fix dba configuration for Windows
To be able to build the dba extension on Windows, libdb was required. This
is contrary to *nix where each handler can be configured individually. To
avoid BC breaks, we only do minimal modifications, instead of adjusting the
Windows configuration to match the *nix configuration, for now.
2016-08-19 11:42:16 +02:00
Davey Shafik 0880bd1bb6 Update NEWS for 7.1.0RC1 2016-08-19 06:51:53 +00:00
Xinchen Hui 566d65d222 Fixed bug #72888 (Segfault on clone on splFileObject) 2016-08-19 11:28:36 +08:00
Davey Shafik 0b1c8178ab Sync NEWS 2016-08-19 09:00:34 +10:00
Nikita Popov 37b0dcc8e0 Decouple DEBUG_FILE_UPLOAD from ZEND_DEBUG
Enabling ZEND_DEBUG should not result in intrusive program
behavior changes.
2016-08-19 00:34:13 +02:00
Christoph M. Becker cf40f999ba Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 18:03:15 +02:00
Christoph M. Becker caf0ad403d Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 17:56:16 +02:00
Christoph M. Becker bc1214f25e Fix broken test include
To avoid that the test stalls, we must always use `t` mode.
2016-08-18 17:53:57 +02:00
Anatol Belski 2a1d35ec6c update NEWS 2016-08-18 17:53:08 +02:00
Anatol Belski b4b8d0887a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-08-18 17:51:18 +02:00
Anatol Belski e6d3221766 update NEWS 2016-08-18 17:50:17 +02:00
Anatol Belski 74cfb2284e fix format 2016-08-18 16:29:46 +02:00
Anatol Belski 2f430a4b6c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  avoid other efforts if memory mapping fails
2016-08-18 16:01:23 +02:00
Anatol Belski 98d8794eae avoid other efforts if memory mapping fails 2016-08-18 15:58:33 +02:00
Julien Pauli 5818b09a45 Updated UPGRADING about function call args 2016-08-18 15:46:02 +02:00
Anatol Belski ecdd24f0fc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2016-08-18 15:36:07 +02:00
Anatol Belski 91cd55e32a fix test 2016-08-18 15:35:26 +02:00
Anatol Belski 20aae1caa3 map ell the err code 2016-08-18 15:28:15 +02:00
Anatol Belski b81a073b85 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72858 shm_attach null dereference
2016-08-18 14:40:20 +02:00
Anatol Belski 67f8c14c29 Fixed bug #72858 shm_attach null dereference 2016-08-18 14:15:10 +02:00
Ferenc Kovacs a2ee13b5ea Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 13:04:43 +02:00
Ferenc Kovacs 7ecd4bb0a4 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 13:03:14 +02:00
Ferenc Kovacs 761d2f629b fix NEWS 2016-08-18 13:01:53 +02:00
Xinchen Hui 1eb4851fa2 Remove leftover of previous change 2016-08-18 15:44:33 +08:00
Xinchen Hui 66a527b8c1 Fixed segfault introduced in 447e57a1e1 2016-08-18 15:37:39 +08:00
Xinchen Hui a3740dadec Remove outdate checks 2016-08-18 15:37:15 +08:00
Christopher Jones 1685282a15 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 15:47:47 +10:00
Christopher Jones 127b42f9b3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 15:47:36 +10:00
Christopher Jones f2d5305097 Add myself as PDO_OCI maintainer 2016-08-18 15:47:25 +10:00
Christopher Jones cb34882e61 Prepare for OCI8 PECL release 2016-08-18 13:58:24 +10:00
Christopher Jones fe3e330c2e Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 13:52:56 +10:00
Christopher Jones 7ed2602af8 Prepare for OCI8 PECL release 2016-08-18 13:52:50 +10:00
Christopher Jones b12ac316eb Prepare for OCI8 PECL release 2016-08-18 13:50:36 +10:00
Anatol Belski 2103e9f21f fix test
The improvements to the base64 functionality allows now to loosen
strictness. Strict mode still can be activated later, if there are
any issues.
2016-08-18 00:18:26 +02:00
Anatol Belski fc1b69888e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  sync NEWS
2016-08-18 00:16:50 +02:00
Anatol Belski 52787e902f sync NEWS 2016-08-18 00:15:54 +02:00
Christoph M. Becker 38f2c6262f Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 22:13:57 +02:00
Christoph M. Becker 9fa0009702 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 22:12:01 +02:00
Christoph M. Becker 54293d21cb Skip tests that are supposed to fail due to bugs in old external libgd 2016-08-17 21:36:26 +02:00
Kalle Sommer Nielsen d85fd07923 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1 2016-08-17 20:27:46 +02:00
Kalle Sommer Nielsen 447e57a1e1 Fixed 7.1 build, decls first please! 2016-08-17 20:26:32 +02:00
Christoph M. Becker 09898f91a3 Make this test also a little more resilient
See <http://git.php.net/?p=php-src.git;a=commit;h=a3159d29bb24d5c946c14b7aa33e96bebcd56e59>.
2016-08-17 19:09:31 +02:00
Christoph M. Becker 7f47dcf31b Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 18:25:45 +02:00
Christoph M. Becker 1bc9ea4f10 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 18:13:41 +02:00
Christoph M. Becker a3159d29bb Make tests a little more resilient
PNG allows identical images to be stored differently what makes nearly all
tests checking the MD5 hash of the PNG representation fail with external
libgd. For now, we use the GD format instead, which doesn't allow for such
differences.

Of course, this md5() checking should be replaced by a image diffing feature
in the long run.
2016-08-17 17:59:33 +02:00
Kalle Sommer Nielsen 1e4cae28b2 Seems like I did a bad merge earlier, this should make PHP-7.0 sync with 7.1/master properly now 2016-08-17 16:34:22 +02:00
Kalle Sommer Nielsen 27ceb6ffb5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix build as done in master in commit 040331c364
  Fixed C89 build
2016-08-17 14:15:09 +02:00
Kalle Sommer Nielsen 9b783107e5 Fix build as done in master in commit 040331c364
The reason why we cannot use round() here, is that it does not come with the standard C library on Windows, I don't think this affects other systems.

At the same time, also expose _php_math_round()
2016-08-17 14:10:24 +02:00
Kalle Sommer Nielsen 8a1fbdda43 Fixed C89 build 2016-08-17 13:43:50 +02:00
Anatol Belski f7231acadf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix char * vs zend_string *
2016-08-17 13:23:31 +02:00
Anatol Belski 06c0540b90 fix char * vs zend_string * 2016-08-17 13:22:02 +02:00
Christoph M. Becker f7d4733b2e Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 12:49:00 +02:00
Christoph M. Becker 356b586ec1 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 12:47:06 +02:00
Christoph M. Becker 48198e4c25 Fix #68302: impossible to compile php with zip support
We should not let configure succeed, if SIZEOF_OFF_T == 0, just to let the
compilation fail later. Instead we bail out early, giving a hint regarding
the potential issue, namely misconfigured libraries.
2016-08-17 12:43:29 +02:00
Anatol Belski 526e6bf818 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix tests
2016-08-17 12:41:38 +02:00
Anatol Belski 05c8a0771d fix tests
The 70436 test is just a bonus for the hardening in 72633.
2016-08-17 12:39:35 +02:00
Xinchen Hui 0fd0328933 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Avoid duplicating string
2016-08-17 18:19:59 +08:00
Xinchen Hui 195d7618e7 Avoid duplicating string 2016-08-17 18:19:14 +08:00
Anatol Belski afa832b5a6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "fix tests"
2016-08-17 12:07:39 +02:00
Anatol Belski 7d4c5a0dc9 Revert "fix tests"
This reverts commit a47df5be19.

Looks like some environment issue, as some system throws the notice,
some don't. Revert for now.
2016-08-17 12:04:03 +02:00
Anatol Belski 60f1ec1c32 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-17 11:53:00 +02:00
Anatol Belski a5d00fc908 fix leak 2016-08-17 11:51:56 +02:00
Xinchen Hui 30e751fe5b Update NEWs 2016-08-17 17:14:53 +08:00
Xinchen Hui ce6ad9bdd9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: (48 commits)
  Update NEWs
  Unused label
  Fixed bug #72853 (stream_set_blocking doesn't work)
  fix test
  Bug #72663 - part 3
  Bug #72663 - part 2
  Bug #72663 - part 1
  Update NEWS
  BLock test with memory leak
  fix tests
  Fix TSRM build
  Fix bug #72850 - integer overflow in uuencode
  Fixed bug #72849 - integer overflow in urlencode
  Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption
  Fix bug #72838 - 	Integer overflow lead to heap corruption in sql_regcase
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72836 - integer overflow in base64_decode caused heap corruption
  Fix for bug #72807 - do not produce strings with negative length
  Fix for bug #72790 and bug #72799
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  ...

Conflicts:
	ext/standard/var_unserializer.c
2016-08-17 17:14:30 +08:00
Xinchen Hui 1dab8e07f2 Update NEWs 2016-08-17 16:56:58 +08:00
Xinchen Hui b172f43caa Unused label 2016-08-17 16:56:20 +08:00
Xinchen Hui 3956deb1b2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72853 (stream_set_blocking doesn't work)

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

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

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

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

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

Conflicts:
	ext/wddx/wddx.c
2016-08-16 23:36:14 +02:00
Anatol Belski 620bb201c4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test cleanup
2016-08-16 22:55:51 +02:00
Anatol Belski f18f394386 fix test cleanup 2016-08-16 22:54:51 +02:00
Anatol Belski 77ea89cb33 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #72857 stream_socket_recvfrom read access violation
2016-08-16 22:50:28 +02:00
Anatol Belski 5391bb8be0 Fixed #72857 stream_socket_recvfrom read access violation 2016-08-16 22:47:50 +02:00
Nikita Popov 7384fcff0a Merge branch 'PHP-7.0' into PHP-7.1 2016-08-16 21:05:57 +02:00
Nikita Popov e2230c17d3 Fix bug #72854 2016-08-16 21:05:30 +02:00
Aaron Piotrowski 6fcedc96fb Fix closure tests using ReflectionType::__toString() 2016-08-16 13:05:51 -05:00
Aaron Piotrowski 20fdd47921 Append \ to class name returned from ReflectionType::__toString() 2016-08-16 11:28:33 -05:00
Nikita Popov ba09a520d2 Cleanup parameter/return type checking code
a) Extract all the logic for error message formatting into a separate
function that is reused for everything.
b) Extract the logic for whether a value matches a type into two
functions, one for user types, one for internal ones.

This tries to fight the increasing code duplication in the type
checking code, whether everything was repeated at least four times
and parts of the error message handling were repeated in dozens of
branches.
2016-08-16 15:48:33 +02:00
Stanislav Malyshev 24fb60ffe9 Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
(cherry picked from commit 620b01337cc39f856ca68c34c35e154f5f0682fc)

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

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

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

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

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

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

Conflicts:
	ext/wddx/wddx.c
2016-08-16 12:46:29 +02:00
Nikita Popov 1397f754c8 Fix handling of qualified nullable parameter types
compile_typename() can't deal with TYPE_NULLABLE flags, drop it
beforehand.
2016-08-16 12:43:17 +02:00
Anatol Belski 67d0fe39ee Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
Conflicts:
	ext/bz2/bz2.c
2016-08-16 12:34:25 +02:00
Dmitry Stogov 443da77c35 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed use after free
2016-08-16 11:44:53 +03:00
Dmitry Stogov ff06588130 Fixed use after free 2016-08-16 11:44:22 +03:00
Christopher Jones 603ed84c13 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-16 16:59:58 +10:00
Christopher Jones 51c1b64fa9 Remove unused OCI8 macros 2016-08-16 16:58:20 +10:00
Matthias Endler ad8b99c888 Fix some typos in PHP FPM configuration
[skip ci]
2016-08-15 22:50:14 +02:00
Nikita Popov f7caa2bd8e Hide (un)serialize data from ABI
The (UN)SERIALIZE_INIT/DESTROY macros now go through non-inlined
functions, so any changes to them will apply to extensions without
rebuilds.

Additionally, the (un)serialize_data structures are now no longer
exported.

This means that we are allowed to change these structures in patch
releases without breaking the ABI.
2016-08-15 22:42:27 +02:00
Xinchen Hui c63260c088 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN)
2016-08-15 23:25:07 +08:00
Xinchen Hui 60de74ebda Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN) 2016-08-15 23:22:55 +08:00
Stanislav Malyshev c2a13ced42 Fix bug #72742 - memory allocator fails to realloc small block to large one 2016-08-14 19:08:59 -07:00
Anatol Belski 51b0398ffc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  put missing prototype and fix ts build
2016-08-14 22:40:20 +02:00
Anatol Belski d6b46901b2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  put missing prototype and fix ts build
2016-08-14 22:39:01 +02:00
Anatol Belski 4a4422740f put missing prototype and fix ts build 2016-08-14 22:35:01 +02:00
Jakub Zelenka 427c8c809d Set DSA or DH key only if pub key supplied 2016-08-14 20:42:56 +01:00
Anatol Belski b783952cb1 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1 2016-08-14 21:00:56 +02:00
Anatol Belski 909b62cda2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
2016-08-14 20:55:41 +02:00
Anatol Belski 32c94deac3 update UPGRADING 2016-08-14 20:55:26 +02:00
Anatol Belski e910b0a8a5 update NEWS 2016-08-14 20:52:47 +02:00
Anatol Belski 9088ef8052 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-08-14 20:51:44 +02:00
Anatol Belski 5c7f802e7e update NEWS 2016-08-14 20:50:23 +02:00
Jakub Zelenka c3c90abb17 Return false if tag is not supplied or cannot be retrieved in AEAD
It doesn't make sense to return just encoded string as it cannot be
used anyway (decryption without a tag will not work).
2016-08-14 19:34:03 +01:00
Anatol Belski e6536b9d6f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72759 Regression in pgo_pgsql
2016-08-14 20:06:44 +02:00
Anatol Belski 245eaf5187 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72759 Regression in pgo_pgsql
2016-08-14 20:04:49 +02:00
Anatol Belski 977cbc2fff Fixed bug #72759 Regression in pgo_pgsql
This is caused by the fix for #72633. Namely, lastval() throws an error,
if no nextval() was called earlier in the same session. This is by all
means correct so far, however inside a transaction it leads to an abort.
This is the opposite to MySQL's last_insert_id() which doesn't produce
any error no matter something were autoincremented or not.

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

libjpeg is rather resilient to such corrupted JPEG files, and raises a
recoverable error in this case. Other image processors also accept such
JPEG files, so we adapt getimagesize() to skip (but warn about) such
extraneous bytes.
2016-08-13 16:14:34 +02:00
Christoph M. Becker f0c77ee7f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 12:06:11 +02:00
Christoph M. Becker a93c62aafa Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 11:47:20 +02:00
Christoph M. Becker ae3b2078ea Fix #72823: strtr out-of-bound access
If php_strtr_array_prepare_repls() reports pattern_len == 0, we return
early to avoid OOB accesses, and because there is nothing to replace anyway.
2016-08-13 11:40:33 +02:00
Christoph M. Becker 02d6e4e517 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 01:29:49 +02:00
Christoph M. Becker 175d94b6e5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 01:21:57 +02:00
Christoph M. Becker 7938ebf6c1 Fix #60665: call to empty() on NULL result using PDO::FETCH_LAZY returns false
The has_property handler only checked whether a respective column name
exists, but neither whether the column value is set, nor whether it is
empty, respectively. We fix that to match the behavior of POD:FETCH_OBJ in
particular and PHP in general.
2016-08-13 01:11:13 +02:00
Christoph M. Becker 040e99f566 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-12 12:55:32 +02:00
Christoph M. Becker 92a076a92b Fix #72793: xml_parser_free leaks mem when execute xml_set_object 2016-08-12 12:54:21 +02:00
Xinchen Hui 0b58d5eb81 Update NEWs 2016-08-12 16:36:57 +08:00
Xinchen Hui dd618664a0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72813 (Segfault with __get returned by ref)
  Fix URL rewriter partially

Conflicts:
	Zend/zend_object_handlers.c
	ext/standard/url_scanner_ex.c
	ext/standard/url_scanner_ex.re
2016-08-12 16:35:41 +08:00
Xinchen Hui fe41f87e46 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix URL rewriter partially
  Support "git worktree"
2016-08-12 16:25:18 +08:00
Xinchen Hui e03480bfab Fixed bug #72813 (Segfault with __get returned by ref)
This should be safe change, as we don't dereference value and member
after calling setter/getter.

And compare to adding unref codes, this is much cheaper.
2016-08-12 16:24:46 +08:00
Yasuo Ohgaki 3467526a65 Merge RFC: Session ID without hashing
https://wiki.php.net/rfc/session-id-without-hashing
2016-08-12 12:31:02 +09:00
Andrea Faulds 1dab96c1db Show "or null" in TypeErrors for nullable arg_infos 2016-08-11 18:44:43 +02:00
Davey Shafik b33e965111 Use non-deprecated %pure-parser 2016-08-11 18:29:55 +02:00
Joey 194ffefb9e Corrected typo in comment
Finger-key interface malfunction.
2016-08-11 18:28:50 +02:00
Levi Morrison 9b6d7f5701 Remove extra pointer in SplFixedArray 2016-08-11 18:25:56 +02:00
Anatol Belski e5d9d009cf add missing chunk to support mb path in symlink() 2016-08-11 13:38:28 +02:00
Anatol Belski 53034feda5 pull ps_title behind the logic to support the current codepage 2016-08-11 13:38:28 +02:00
Anatol Belski 525eb35667 fix typo 2016-08-11 13:38:28 +02:00
Anatol Belski 6359c7a2bf add missing mb path support chunk 2016-08-11 13:38:28 +02:00
Aaron Piotrowski 622d2f41d1 ReflectionType improvements
Added ReflectionNamedType and updated ReflectionType::__toString()
2016-08-11 12:19:33 +02:00
Ville Hukkamäki 283b0cc8a5 Fix #72810. Add check for SKIP_ONLINE_TESTS 2016-08-11 12:01:24 +02:00
Stanislav Malyshev 6304a611cd Use size_t for path length 2016-08-10 23:46:58 -07:00
Stanislav Malyshev 7bf6d98535 Check for string overflow 2016-08-10 23:46:33 -07:00
Stanislav Malyshev 4f6a97f532 Fix for bug #72782: mcrypt accepts only ints, so don't pass anything else 2016-08-10 22:39:03 -07:00
Yasuo Ohgaki ae3782a0db Fix URL rewriter partially 2016-08-11 09:18:47 +09:00
Yasuo Ohgaki f19578ad58 Fix URL rewriter partially 2016-08-11 09:18:33 +09:00
Yasuo Ohgaki a53a6b3fb4 Fix URL rewriter issues 2016-08-11 08:31:48 +09:00
Yasuo Ohgaki 2644943968 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Support "git worktree"
2016-08-11 08:09:37 +09:00
Yasuo Ohgaki 5bf14e4699 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Support "git worktree"
2016-08-11 08:09:05 +09:00
Yasuo Ohgaki a38bc7b373 Support "git worktree" 2016-08-11 08:08:26 +09:00
Leigh 9a9004318f Preserve BC for rand() AND mt_rand() where min > max 2016-08-10 23:32:32 +01:00
Christoph M. Becker 24fdffdacb Update to SQLite 3.14.0 2016-08-10 18:09:38 +02:00
Keyur 40059beed8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add NEWS
  Fix ASSERT logic
  Bugfix 72791: fix memory leak in PDO persistent connections
2016-08-09 17:30:26 +00:00
Keyur bb955ec937 Add NEWS 2016-08-09 17:29:36 +00:00
Keyur 2b7715b925 Merge branch 'pull-request/2067' into PHP-7.0 2016-08-09 17:27:52 +00:00
Keyur 2ab9a2d4be Fix ASSERT logic 2016-08-09 14:41:20 +00:00
Keyur 98e4d509f6 Bugfix 72791: fix memory leak in PDO persistent connections 2016-08-09 14:01:25 +00:00
Nikita Popov 2fbfa7f62e Merge branch 'PHP-7.0' into PHP-7.1 2016-08-09 15:35:04 +02:00
Nikita Popov 842e408c67 Don't copy mime types in CLI server
This is both unnecessary and causes leaks in valgrind.
2016-08-09 15:34:03 +02:00
Christoph M. Becker b50a4a485a Class constant visibility modifiers are now supported 2016-08-09 11:54:43 +02:00
Christopher Jones a3fdc5f680 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-09 16:13:27 +10:00
Christopher Jones 3c5e6b29ce Remove obsolete Id tags 2016-08-09 16:12:58 +10:00
Christopher Jones 3dbeb6118d Merge branch 'PHP-7.0' into PHP-7.1 2016-08-09 16:00:44 +10:00
Christopher Jones 797f69ef32 Bump version in OCI8 test 2016-08-09 15:59:59 +10:00
Xinchen Hui ecc4025c71 Update NEWS 2016-08-09 11:32:55 +08:00
Xinchen Hui 3f1e9ed8f8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72788 (Invalid memory access when using persistent PDO connection)
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
2016-08-09 11:32:34 +08:00
Xinchen Hui e52cb1858d Fixed bug #72788 (Invalid memory access when using persistent PDO connection) 2016-08-09 11:32:16 +08:00
Xinchen Hui ebd21de1e4 Merge branch 'bug72788' of https://github.com/keyurdg/php-src into PHP-7.0
* 'bug72788' of https://github.com/keyurdg/php-src:
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
2016-08-09 11:25:32 +08:00
Keyur a74c7cb528 Remove typo'd commit 2016-08-09 01:36:15 +00:00
Keyur 3f25c4228a Fix bug 72788: Invalid memory access when database_object_handle
is undefined. Also fix memory leak in dbh_free when using persistent
PDO connections.
2016-08-09 00:16:46 +00:00
Leigh 2ece5decb7 Swap min/max if min > max 2016-08-08 22:31:59 +01:00
Leigh 99e3bb1430 Allow min > max for mt_rand(). Bug #72784 2016-08-08 22:16:27 +01:00
Andrea Faulds ab45f13a0b Merge branch 'PHP-7.0' into PHP-7.1 2016-08-08 21:00:49 +01:00
Andrea Faulds 5358c7cf5e Replace dead branch with ZEND_ASSERT() 2016-08-08 20:56:11 +01:00
Christoph M. Becker e8d8169fc1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-08 18:51:34 +02:00
Nikita Popov cf017ce17f Fix array_column() packed hash initialization
FILL assumes enough space is alredy allocated -- do that. Note that
the used size is an upper bound, albeit a likely one.
2016-08-08 18:47:52 +02:00
Christoph M. Becker 9d03310b23 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-08 18:45:27 +02:00
Christoph M. Becker 243d5fcb1f Add test for bug #69107: finfo no longer detects PHP files 2016-08-08 18:43:33 +02:00
Anatol Belski 33a7ad2365 check malloc result 2016-08-08 10:33:07 +02:00
Christoph M. Becker f706897f33 Implement #38992: invoke() and invokeArgs() static method calls should match
We don't want ReflectionMethod::invoke() to simply ignore its first argument,
if the method to invoke is a static method. Instead we match its ZPP with
that of ReflectionMethod::invokeArgs(). Furthermore, we apply the DRY
principle by factoring out the code to a common helper function to prevent
inadvertent future divergence of the implementations of both methods.

As can be seen from the necessity to adapt some test cases, this causes a
BC break for some pathological cases. Therefore we apply this patch to PHP
7.1 only, which is still in beta phase.
2016-08-08 01:43:03 +02:00
Nikita Popov e52c1f3ca9 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 18:50:27 +02:00
Lauri Kenttä e616bc8694 Fix bug #55451
Make substr_compare ignore the length if it's NULL. This allows to
use the last parameter (case_insensitivity) with the default length.
2016-08-07 18:48:36 +02:00
Nikita Popov f350e20da6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 18:38:43 +02:00
Nikita Popov 56d7e98ddf Merge branch 'PHP-5.6' into PHP-7.0 2016-08-07 18:38:28 +02:00
Nikita Popov 40d237df1f Fix stream_socket_enable_crypto() test
The whole test doesn't make any sense at all, but this only fixes
the additional warnings you get when linked against openssl w/o
SSL3.
2016-08-07 18:37:38 +02:00
Nikita Popov af77c53ee1 Fix PUTC warning
Change the macro to not provide a useless return value using a
comma expression, which generates warnings.
2016-08-07 17:43:20 +02:00
Nikita Popov 3823bfc6f2 Avoid use of scratch space in HTTP fopen wrapper
Instead directly write into req_buf smart_str.
2016-08-07 17:43:06 +02:00
Christopher Jones 40bbf4ec06 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 10:25:16 +10:00
Christopher Jones dd7cdab8e4 Remove old $Id$ tags 2016-08-07 10:24:56 +10:00
Christopher Jones 9acafa16b1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 10:21:14 +10:00
Christopher Jones 944d473eaa Sync with 7.1 branch changes from Nikita & Dimitri to keep OCI8 code identical 2016-08-07 10:17:06 +10:00
Christopher Jones fadbb30e66 News for 7.1 2016-08-07 10:06:11 +10:00
Christopher Jones f16285b35a Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 10:02:14 +10:00
Christopher Jones b601dc5b29 Fix bug #72524 (Binding null values triggers ORA-24816 error) 2016-08-07 09:39:44 +10:00
Leigh 5bf39267ee mt_rand 32/64-bit consistency 2016-08-06 11:15:26 +01:00
Kalle Sommer Nielsen 3d51b1d544 Fix the fix (Nikita), thanks! 2016-08-06 12:08:13 +02:00
Kalle Sommer Nielsen 5e2b8349b4 Check the return value of dbconvert() in mssql_guid_string(), as it may return -1 in case the conversion failed. In that case false is returned.
Also initialize buffer and buffer2 to NULL, which should fix bug #72039 (Use of uninitialised value on mssql_guid_string).

This only applies to 5.6, as we do not have mssql in 7.0 anymore
2016-08-06 10:17:49 +02:00
Nikita Popov be31515cc6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-05 23:10:12 +02:00
Nikita Popov a2a2ea18fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-05 23:09:30 +02:00
Ville Hukkamaki 65056e9d6c Fix #72764
Negotiate data channel encryption after NLST command.
This is to prevent issues with IIS and ProFTPD.
2016-08-05 22:56:54 +02:00
Nikita Popov 3859bcd1f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-05 19:56:27 +02:00
Nikita Popov 807e81937b Fix bug #72767
The page size calculation did not account for the size of the
stack header (or rather it did account for it, but in the wrong
direction...)
2016-08-05 19:55:10 +02:00
Nikita Popov 1a780e6727 Add assertion to prevent type narrowing
Currently type narrowing is always a bug, make sure we know about
it.
2016-08-05 16:30:57 +02:00
Nikita Popov fc7c81ff54 Fixed bug #72762 2016-08-05 16:27:55 +02:00
ju1ius 03d03243fa Fix #72711: mb_ereg does not clear the $regs parameter on failure
When `mb_ereg` failed to match, it didn't update the `$regs` argument.
Now it will always set it to the empty array.
2016-08-05 13:22:10 +02:00
Ville Hukkamäki 318d3b3a3f Implement request #27814
Construct HTTP request headers into smart_str and send whole
request in one go.
2016-08-04 14:20:36 +02:00
Xinchen Hui 3800e1cf97 Fixed bug #72743 (Out-of-bound read in php_stream_filter_create) 2016-08-04 19:10:40 +08:00
Christoph M. Becker 5b547af1ad Merge branch 'PHP-7.0' into PHP-7.1 2016-08-04 12:10:34 +02:00
Christoph M. Becker 62f12a8b86 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-04 12:09:16 +02:00
Christoph M. Becker a8515a339d Fix broken skip marker in test case 2016-08-04 12:06:07 +02:00
Matteo Beccati 70698d1566 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Clean up FR #72633
  Fixed invalid handle error with Implicit Result Sets and bump OCI8 version.

Conflicts:
	ext/oci8/package.xml
2016-08-04 09:37:40 +02:00
Matteo Beccati 4003595d60 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Clean up FR #72633
2016-08-04 09:30:48 +02:00
Matteo Beccati d3a8e107ac Clean up FR #72633 2016-08-04 09:28:58 +02:00
Christopher Jones 0781f512c3 Fixed invalid handle error with Implicit Result Sets and bump OCI8 version. 2016-08-04 17:14:19 +10:00
Christopher Jones 2b7a699acd Fixed invalid handle error with Implicit Result Sets 2016-08-04 17:01:57 +10:00
Christopher Jones 78488a54c8 Fixed invalid handle error with Implicit Result Sets and bump OCI8 version. 2016-08-04 16:55:54 +10:00
Christopher Jones 06be3c659c Merge branch 'PHP-7.0' of https://git.php.net/repository/php-src into PHP-7.0 2016-08-04 16:45:29 +10:00
Stanislav Malyshev 67264ebc70 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #72716 - initialize buffer before read
2016-08-03 23:03:15 -07:00
Stanislav Malyshev b57474f23e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72716 - initialize buffer before read

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-03 23:00:32 -07:00
Stanislav Malyshev 4f861b6071 Fix bug #72716 - initialize buffer before read 2016-08-03 22:59:42 -07:00
Ferenc Kovacs 7d4f5e3938 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-04 01:43:27 +02:00
Ferenc Kovacs db4211a8fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	configure.in
	main/php_version.h
2016-08-04 01:42:00 +02:00
Ferenc Kovacs 562c17eb4e 5.6.26 will be next 2016-08-04 01:39:37 +02:00
Nikita Popov ec6d70db77 Fix leak on self-referencing constants 2016-08-03 23:10:09 +02:00
Davey Shafik b304ab5c70 Move fix for #72735 to 7.1.0beta3 2016-08-03 12:31:15 -07:00
Anatol Belski 662e5ae951 improve the check, avoid strlen on NULL 2016-08-03 12:29:03 -07:00
Kalle Sommer Nielsen 835ef14979 Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.

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

This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further.
2016-08-03 12:29:03 -07:00
Jakub Zelenka 6822af2e73 Do not add already added object to the internal OpenSSL table
This fixes OpenSSL 1.1 where adding object with OID that has been
already added causes an error - preventing of duplication.
2016-08-03 20:01:41 +01:00
Anatol Belski 8f0baa9707 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  improve the check, avoid strlen on NULL
2016-08-03 18:29:42 +02:00
Anatol Belski 138689ffb7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve the check, avoid strlen on NULL
2016-08-03 18:28:48 +02:00
Anatol Belski 9667ee4f72 improve the check, avoid strlen on NULL 2016-08-03 18:26:29 +02:00
Anatol Belski a60e1bfedf update NEWS 2016-08-03 17:42:45 +02:00
Anatol Belski 8830b3d020 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
  Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
2016-08-03 17:40:38 +02:00
Anatol Belski 2bdb34fd40 update NEWS 2016-08-03 17:39:55 +02:00
Anatol Belski 0e82eb48cb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
2016-08-03 17:39:22 +02:00
Anatol Belski f15c155363 update NEWS 2016-08-03 17:38:11 +02:00
Kalle Sommer Nielsen d5796fb298 Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.

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

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

(cherry picked from commit aabcb5481d)
2016-08-03 17:36:00 +02:00
Anatol Belski c17092fc13 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update libs_versions.txt
  update libs_versions.txt
2016-08-03 15:06:39 +02:00
Anatol Belski e3dabe448d update libs_versions.txt 2016-08-03 15:06:02 +02:00
Anatol Belski 7922e0f0bf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-08-03 15:05:39 +02:00
Anatol Belski 67c2b0a9e8 update libs_versions.txt 2016-08-03 15:03:41 +02:00
Remi Collet f9ce8aa75b Minor revert of be3640150c
On 32bits this may cause php to hangs forever.
2016-08-03 14:27:46 +02:00
Remi Collet a70ca97c18 fix paths in tests 2016-08-03 14:24:35 +02:00
Remi Collet 8b7f594a2b clean removed functions (since they are alias) 2016-08-03 12:59:14 +02:00
Remi Collet cff668f7a7 Fix 32bits tests
Notice: this warning is only raise since rand is an alias to mt_rand
2016-08-03 12:56:07 +02:00
Anatol Belski 39587c4817 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix ts build
2016-08-03 12:20:23 +02:00
Anatol Belski 151c39827a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix ts build
2016-08-03 12:19:29 +02:00
Anatol Belski fad3f936ac fix ts build 2016-08-03 12:16:42 +02:00
Remi Collet 60bb15d8a1 add skipif (needs json) 2016-08-03 11:03:22 +02:00
Stanislav Malyshev 72dbb7f416 Fix bug #72674 - check both curl_escape and curl_unescape 2016-08-03 00:58:55 -07:00
Xinchen Hui 6d1f473247 It's packed array 2016-08-03 12:37:14 +08:00
Xinchen Hui be00b4ed13 Optmized array_rand 2016-08-03 12:06:04 +08:00
Xinchen Hui 501d24f81b Optimized array_pad 2016-08-03 11:24:31 +08:00
Davey Shafik 9ecefe72d8 Update NEWS for 7.1.0beta3 2016-08-02 16:40:07 -07:00
Nikita Popov 41e93041f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-03 00:35:00 +02:00
Nikita Popov 1bcd439cad Fix bug #72724 2016-08-03 00:34:36 +02:00
Christoph M. Becker 3d0002ed36 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-02 18:56:35 +02:00
Christoph M. Becker 3a8c027ec3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-02 18:49:59 +02:00
Christoph M. Becker f5622f5c87 Fix #72709: imagesetstyle() causes OOB read for empty $styles
Calling imagesetstyle() with an empty $styles array caused gdImageSetStyle()
to be called with `noOfPixels==0`, what could have lead to OOB reads.
Actually, this issue will be fixed in libgd, but to avoid issues when older
libgd is in use, we simply disallow passing an empty $styles array to
imagesetstyle(), what wouldn't serve a useful purpose anyway.
2016-08-02 18:43:37 +02:00
Anatol Belski 02fce3ecea Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  cleanup table after test
  - lastInsertId using Postgres Lastval() function
2016-08-02 14:42:55 +02:00
Anatol Belski 072af35b5c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  cleanup table after test
  - lastInsertId using Postgres Lastval() function
2016-08-02 14:40:31 +02:00
Anatol Belski e95625f47e update NEWS 2016-08-02 14:36:56 +02:00
Anatol Belski 40b3a031b2 cleanup table after test 2016-08-02 14:35:24 +02:00
Pablo Santiago Sánchez 90c6cbd09b - lastInsertId using Postgres Lastval() function 2016-08-02 14:34:30 +02:00
Xinchen Hui 82ba5b59d9 Fixed warning: "operation on ‘s’ may be undefined" 2016-08-02 20:28:42 +08:00
Xinchen Hui 81a7d52814 Folder marks 2016-08-02 20:08:15 +08:00
Xinchen Hui 70f79fd8b6 Optimized array_merge and cleanup 2016-08-02 20:02:23 +08:00
Xinchen Hui 87057858a0 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  prepare next
  fix php_version.h
2016-08-02 17:40:37 +08:00
Xinchen Hui e730c8fc90 Optimized array_merge 2016-08-02 17:39:53 +08:00
Anatol Belski 45eadced70 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  prepare next
2016-08-02 11:15:07 +02:00
Anatol Belski 5c51433e2a prepare next 2016-08-02 11:13:20 +02:00
Anatol Belski ed863e45da Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix php_version.h
2016-08-02 11:08:21 +02:00
Anatol Belski 9f14920725 fix php_version.h 2016-08-02 11:06:33 +02:00
Xinchen Hui fea2042a47 Optimized array_column (thanks to Benjamin Coutu) 2016-08-02 12:40:46 +08:00
Xinchen Hui a15902fa71 fixed IS_REFERENCE handling 2016-08-02 11:05:51 +08:00
Xinchen Hui f93061471b Make the expression more reasonble (by nikic) 2016-08-01 20:20:01 +08:00
Xinchen Hui 4d9195927a Optimized array_reverse 2016-08-01 20:11:08 +08:00
Anatol Belski 318102fc60 update NEWS 2016-07-31 15:01:45 +02:00
Anatol Belski db9baae4fb Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Revert "upgraded to PCRE 8.39"
2016-07-31 15:00:18 +02:00
Anatol Belski 753e6eacd5 update NEWS 2016-07-31 14:58:46 +02:00
Anatol Belski 5f9df47ea8 Revert "upgraded to PCRE 8.39"
This reverts commit 2fba646837.

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

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

(cherry picked from commit 0fb7eb6723bcc6fd98053911543e801edb5ab763)
2016-07-30 11:46:34 +02:00
Nikita Popov ca82574d7c Fix invalid free on undef const in update_const()
Also clean up the control flow a bit -- move all unqualified
constant handling in one branch.
2016-07-30 00:37:01 +02:00
Nikita Popov 11e050920d Fix memory unsafety in array_walk()
Fixes bugs #61967, #62607, #69068, #70713.

The primary changes are:
a) Use the ht_iterator mechanism to ensure safety not only if the
   iterated array itself changes, but also if it is replaced (and
   potentially destroyed) entirely. We use the same semantics for
   behavior under modification as foreach-by-reference. In
   particular, we advance to the next element before processing it.
   If the iterated entity is exchanged we iterate the new one from
   the start. If it is not an array/object we warn and abort.
b) Always create a reference to the current value. Previously the
   code kept the value as a non-reference and updated it to the
   reference value produced by the user callback. However this is
   unsafe, as the array may have been reallocated in the meantime,
   so the previous value pointer is no longer value.
c) Around a recursive walk, incref the reference containing the
   array. This ensures that the location where the currently
   iterated value is stored cannot be freed.

One problem I was not able to solve is that we cannot decrement
the apply count if the array is exchanged during a recursive walk.
2016-07-30 00:15:32 +02:00
Nikita Popov 261c436d8c Merge branch 'PHP-7.0' into PHP-7.1 2016-07-29 19:08:15 +02:00
Nikita Popov 8a442a33c3 Fix ref handling in array_merge/replace_recursive()
As usual, if the reference has rc=1 it really isn't a reference.
2016-07-29 19:07:04 +02:00
Anatol Belski 5b6f793644 update NEWS 2016-07-29 17:33:40 +02:00
Anatol Belski 9b9aeb66bd add test for bug #72701 2016-07-29 17:23:39 +02:00
Anatol Belski 8033fb4044 Fixed bug #72701 mysqli_get_host_info() wrong output 2016-07-29 17:00:52 +02:00
Anatol Belski fe8daf2a28 fix typo 2016-07-29 15:08:55 +02:00
Anatol Belski d6f7020eaa add more errno handling 2016-07-29 15:05:41 +02:00
Anatol Belski d8403aa019 set errno in ioutil access routine 2016-07-29 14:31:06 +02:00
Anatol Belski 6dbfd4287b move error check to right place
this only makes sense when length was passed
2016-07-29 13:33:58 +02:00
Anatol Belski 0596a2561b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  document file cache fallback ini directive
2016-07-29 13:07:43 +02:00
Anatol Belski 1666e80cb9 document file cache fallback ini directive 2016-07-29 13:04:51 +02:00
Christoph M. Becker a837b2f6a3 Fix #72320: iconv_substr returns false for empty strings
For consistency with substr() and mb_substr(), iconv_substr() should return
an empty string instead of FALSE, when $offset == iconv_strlen($str).
2016-07-29 11:33:50 +02:00
Anatol Belski 41d172d20f fix and improve the ioutil cwd routine for nts
- move intermediate var to stack
- fix length calculation
- improve error code setting
2016-07-29 02:41:00 +02:00
Christoph M. Becker 09b5a453c1 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-29 01:27:51 +02:00
Christoph M. Becker 293dd3d701 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/calendar/calendar.c
2016-07-29 01:26:15 +02:00
Christoph M. Becker f67ccd4a7b Fix #71894: AddressSanitizer: global-buffer-overflow in zif_cal_from_jd
Julian days < 347998 denote invalid Jewish calendar dates, so
cal_from_jd($jd, CAL_JEWISH) and jdmonthname($jd, CAL_MONTH_JEWISH) should
actually fail. For BC we don't yet let them though, but we fix the OOB read
that happens in this case, and we also adjust cal_from_jd()'s return value
to have empty strings for "abbrevdayname" and "dayname" instead of "Sun"/
"Sunday" and NULL for "dow" instead of 0, which doesn't make any sense.
2016-07-29 01:04:21 +02:00
Christoph M. Becker 834919f0a5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 20:09:50 +02:00
Christoph M. Becker a952aac6a7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 20:00:37 +02:00
Christoph M. Becker 5c458c9b02 Implement FR #65462: Please add tests for gregorian and jewish overflow fixes 2016-07-28 19:59:14 +02:00
Christoph M. Becker 28ade0e102 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 19:25:22 +02:00
Christoph M. Becker 7c412688f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 19:22:40 +02:00
Christoph M. Becker 7ab39e2fae Fix #67976: cal_days_month() fails for final month of the French calendar
The French calendar ends on 0014-13-05, so trying to calculate the Julian
day of 0015-01-01 fails. We cater to that by returning the hard-coded value.
2016-07-28 19:13:58 +02:00
Nikita Popov 1315a3dd62 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 18:52:04 +02:00
Nikita Popov 3b48c5a36f Revert "Make call_user_func() on reference args consistent"
This reverts commit fafe01b07b.

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

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

We make that facility available to userland.

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

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

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

Bug was introduced 2006-05-14 (Before 5.2.0)
2016-07-27 00:33:13 -04:00
Pierrick Charron a8c4a4262e Merge branch 'PHP-7.0' into PHP-7.1 2016-07-26 20:37:04 -04:00
Pierrick Charron 2597f5d665 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_iterators.c
2016-07-26 20:36:34 -04:00
Pierrick Charron 4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Pierrick Charron ca493af862 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-26 19:23:08 -04:00
Pierrick Charron 31ed322b06 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-26 19:20:12 -04:00
Pierrick Charron 24d8f6ed7c Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
2016-07-26 18:50:15 -04:00
Anatol Belski 21f80a00a9 fix broken proto doc 2016-07-26 16:29:24 +02:00
Anatol Belski 866e551c0a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  upgraded to PCRE 8.39
2016-07-26 15:12:03 +02:00
Anatol Belski 2fba646837 upgraded to PCRE 8.39
(cherry picked from commit 9d4fe9672a)
2016-07-26 15:07:04 +02:00
Anatol Belski a35adb8b22 fix missing header and conflicting symbol 2016-07-26 14:00:24 +02:00
Anatol Belski 893e3b06ea fix compiler warning 2016-07-26 07:53:24 +02:00
Anatol Belski 3958f7af00 fix data type 2016-07-26 07:53:24 +02:00
Nikita Popov 4d2479202a Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 23:04:14 +02:00
Nikita Popov b1d36cb820 Fix GMP unserialization with self-reference 2016-07-25 23:04:00 +02:00
Andrey Hristov b27ff62ee0 Fix for bug #71863 Segfault when EXPLAIN with "Unknown column" error
The reason was that after the big refactoring of mysqlnd at the end of
last year code that is initializing the error_info structure in the
result set was not added. It existed already for connections and PS.
The code that segfaults is hit only with MariaDB because MariaDB sends
full metadata about the EXPLAIN query + EOF packet and only then it sends
an error packet. MySQL doesn't do that but sends directly an error which
is caught (by different code path). As errors during execution (which means
after sending meta) are pretty rare there was no test case of MySQL to
catch it.
2016-07-25 21:59:27 +02:00
Christoph M. Becker ac0bbea3a8 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 17:15:10 +02:00
Christoph M. Becker ccf39dd552 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/sqlite3/sqlite3.c
#	ext/sqlite3/tests/bug72668.phpt
2016-07-25 17:07:41 +02:00
Christoph M. Becker 64e3e932fc Further fixes wrt. bug #72668
Not only SQLite3::querySingle(), but also SQLite3::query() and
SQLite3Stmt::execute() were affected.
2016-07-25 17:03:10 +02:00
Anatol Belski 2334d8335b use more suitable types here, too
and simplify the loop
2016-07-25 14:46:20 +02:00
Anatol Belski 198c2ec5f0 change to more suitable datatypes 2016-07-25 14:46:20 +02:00
Xinchen Hui 2abb56e0bd Update NEWs 2016-07-25 20:29:26 +08:00
Xinchen Hui 088905bf60 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72668 (Spurious warning when exception is thrown in user defined function)
2016-07-25 20:28:57 +08:00
Xinchen Hui f5e56cf970 Fixed bug #72668 (Spurious warning when exception is thrown in user defined function) 2016-07-25 20:28:39 +08:00
Anatol Belski 0d5050225d update NEWS 2016-07-25 12:50:21 +02:00
Anatol Belski bd9a5b183c Fixed bug #72658 Locale::lookup() / locale_lookup() hangs if no match found 2016-07-25 12:49:13 +02:00
Christoph M. Becker ee07e23e8e Fix SQLite3 header files
While sqlite3.c had already been updated to 3.13.0, the header files had
been forgotten.
2016-07-25 10:27:21 +02:00
Anatol Belski 6bb2c7f63f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Make phpize use PHP_PREFIX as the default location (windows)
  Enable 'nmake test' on building extensions
2016-07-25 10:18:10 +02:00
Anatol Belski 9a4c9348b1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Make phpize use PHP_PREFIX as the default location (windows)
  Enable 'nmake test' on building extensions
2016-07-25 10:17:41 +02:00
Anatol Belski 0c34d515f1 update NEWS 2016-07-25 10:14:18 +02:00
y-uti 3f842655db Make phpize use PHP_PREFIX as the default location (windows)
The default path to where an extension is installed should be
PHP_PREFIX/ext on windows.
2016-07-25 10:01:34 +02:00
y-uti 72ac8cf5ad Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test'
target rule. This commit fixes that and enables 'nmake test' on
Windows.
2016-07-25 09:55:07 +02:00
Anatol Belski 30118e33b3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Enable 'nmake test' on building extensions
  Make phpize use PHP_PREFIX as the default location (windows)
2016-07-25 09:52:38 +02:00
Anatol Belski 59de6fb268 update NeWS 2016-07-25 09:52:21 +02:00
Anatol Belski 27dd8048b7 update NEWS 2016-07-25 09:51:13 +02:00
y-uti 0f9bf85ad9 Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test'
target rule. This commit fixes that and enables 'nmake test' on
Windows.
2016-07-25 09:46:06 +02:00
y-uti 6ed7136371 Make phpize use PHP_PREFIX as the default location (windows)
The default path to where an extension is installed should be
PHP_PREFIX/ext on windows.
2016-07-25 09:46:00 +02:00
Christoph M. Becker 387847a0b2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 02:03:54 +02:00
Christoph M. Becker 138fea83fe Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 02:02:54 +02:00
Christoph M. Becker 305bddb0ed Fix broken test case
d28f1da introduced a test regression, due to potentially additional output
regarding FreeType support. We fix that by making the test more resilient.
2016-07-25 02:00:37 +02:00
Christoph M. Becker d55a773223 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 00:25:11 +02:00
Christoph M. Becker 4db4997ac5 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 00:16:21 +02:00
Christoph M. Becker d28f1dae9d Fix broken test case
The test claims that it would be "checking all the values in returned array",
but due to the use of %a it actually skipped elements. We fix that by using
%s instead.
2016-07-25 00:13:44 +02:00
Xinchen Hui 3d33eb743d Update NEWS 2016-07-24 23:59:05 +08:00
Xinchen Hui 393d56f1e3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd)
2016-07-24 23:58:50 +08:00
Xinchen Hui ad96a052d9 Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd) 2016-07-24 23:58:22 +08:00
Anatol Belski fcc9386578 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  regenerate date parser with re2c 0.15.3
  regenerate date parser with re2c 0.15.3
2016-07-24 14:55:15 +02:00
Anatol Belski da3995852e regenerate date parser with re2c 0.15.3 2016-07-24 14:53:53 +02:00
Anatol Belski 8eb94b6e32 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  regenerate date parser with re2c 0.15.3
2016-07-24 14:51:59 +02:00
Anatol Belski 9cd23ff84f regenerate date parser with re2c 0.15.3 2016-07-24 14:50:10 +02:00
Xinchen Hui 9b34f44f41 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src: (32 commits)
  fix compiler warning
  rework long path normalization stuf
  More tolerance in another IntlCalendar test
  Ensure session GC is not run during variation6.phpt
  add folds
  improve typedef and fix the fake function
  add missing cast
  Fix typos, previous version used reserver/reserverd/reserved
  Fixed bug #72625 realpath() fails on non canonical long path
  correct comment
  don't return long path prefix to script
  fix test
  fix test
  Fix #68712: suspicious if-else statements
  Fix copy&paste errors in gd_interpolation.c
  Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
  Fix ClosedGeneratorException possibly thrown into wrong scope
  Fix for bug #54431
  Fix build
  Make sure TOKEN_PARSE mode is thread safe
  ...
2016-07-24 11:03:49 +08:00
Xinchen Hui a3a797dbd5 Fixed bug #72661 (ReflectionType::__toString crashes with iterable) 2016-07-24 11:01:19 +08:00
Anatol Belski addb2e22b3 fix compiler warning 2016-07-24 03:51:53 +02:00
Anatol Belski 4acde210fd rework long path normalization stuf
Simplify, set error codes, ensure 32-bit is ok as well. The
canonicalization part is still an issue on win7 as the API
is missing there. However a partial improvement is reached
there as well thanks to the slash conversion.
2016-07-24 03:51:47 +02:00
Nikita Popov ca64223193 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-24 00:18:51 +02:00
Nikita Popov aecc435482 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-24 00:18:47 +02:00
Nikita Popov 04b42b1e05 More tolerance in another IntlCalendar test
Again, off-by-1000 is expected if we're late in the second. Add an
extra 1000 to account for actual delta in call times.
2016-07-24 00:15:14 +02:00
Nikita Popov 42e995e0d3 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-24 00:08:18 +02:00
Nikita Popov 2194690625 Ensure session GC is not run during variation6.phpt
The implemented gc() handler simply deletes all sessions, including
the current one. This may cause a subsequent unlink() warning.
Avoid this by preventing GC from running.
2016-07-24 00:07:54 +02:00
Anatol Belski 69ae61af96 add folds 2016-07-23 23:24:32 +02:00
Anatol Belski 88d4f149a6 improve typedef and fix the fake function 2016-07-23 23:24:32 +02:00
Anatol Belski 40557fdc34 add missing cast 2016-07-23 23:24:32 +02:00
Sjon Hortensius 66626cc223 Fix typos, previous version used reserver/reserverd/reserved 2016-07-23 23:14:14 +02:00
Anatol Belski 0f16c56262 Fixed bug #72625 realpath() fails on non canonical long path 2016-07-23 21:11:27 +02:00
Anatol Belski fc30b8e0f7 correct comment 2016-07-23 21:11:27 +02:00
Anatol Belski 7d83324105 don't return long path prefix to script 2016-07-23 21:11:27 +02:00
Anatol Belski 3d95cc50a7 fix test 2016-07-23 21:06:11 +02:00
Anatol Belski b238211732 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2016-07-23 21:04:52 +02:00
Anatol Belski 958fa34c16 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test
2016-07-23 21:03:45 +02:00
Anatol Belski 80fee637f4 fix test 2016-07-23 20:55:39 +02:00
Christoph M. Becker 8aa9ddb4d2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 19:38:45 +02:00
Christoph M. Becker 2c0a18480d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 19:36:53 +02:00
Christoph M. Becker 88838dd282 Fix #68712: suspicious if-else statements 2016-07-23 19:29:43 +02:00
Christoph M. Becker 88bc54d3dc Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 18:13:29 +02:00
Christoph M. Becker 03ccd42b18 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 18:12:14 +02:00
Christoph M. Becker 9fbd0c1ff1 Fix copy&paste errors in gd_interpolation.c
According to <https://github.com/libgd/libgd/commit/f101380>.
2016-07-23 18:09:18 +02:00
Christoph M. Becker 03eeea4aa5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 16:57:12 +02:00
Christoph M. Becker 5056d59f96 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 16:55:16 +02:00
Christoph M. Becker 2c16b9cf62 Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
This issue has already been fixed in libgd[1], so we fix PHP's bundled
libgd accordingly.

[1] <https://github.com/libgd/libgd/commit/aa1d71c>
2016-07-23 16:48:07 +02:00
Bob Weinand 35764e3579 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-23 16:40:02 +02:00
Bob Weinand 6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Nikita Popov 696d6e7c90 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 13:30:55 +02:00
Nikita Popov f12fd5c2d3 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-23 13:29:57 +02:00
vhuk 65abdb556d Fix for bug #54431 2016-07-23 13:28:42 +02:00
Nikita Popov f4d1af7981 Fix build
Missed this occurrence...
2016-07-23 00:12:11 +02:00
Nikita Popov 07af6ba898 Make sure TOKEN_PARSE mode is thread safe
Introduce an on_event_context passed to the on_event hook. Use this
context to pass along the token array. Previously this was stored
in a non-tls global :/
2016-07-23 00:00:13 +02:00
Nikita Popov 40b312d4c2 Use OPENSSL_RAW_DATA in raw data decryption tests 2016-07-22 18:30:30 +02:00
Nikita Popov bb51da29dc Make base64_decode() in non-strict mode binary safe 2016-07-22 18:20:34 +02:00
Nikita Popov e1216f6fc1 Add NEWS entries 2016-07-22 18:07:45 +02:00
Lauri Kenttä cab5f6a889 base64_decode: Add tests 2016-07-22 18:03:56 +02:00
Lauri Kenttä 316d5a19a6 base64_decode: Handle all invalid padding equally 2016-07-22 18:03:56 +02:00
Lauri Kenttä 5c62f3f68e base64_decode: strict: Fail on excessive padding 2016-07-22 18:03:56 +02:00
Lauri Kenttä 586a0761ff base64_decode: strict: Fail on truncated input 2016-07-22 18:03:56 +02:00
Lauri Kenttä 0981e5de3c base64_decode: Avoid code duplication in failures 2016-07-22 18:03:55 +02:00
Lauri Kenttä 7a02704c0e Require strict base64 in data URI
As the tests already show, the data URI wrapper is supposed to fail
for corrupt input, but for some reason, one case of invalid input is
still allowed to pass?! Strict base64 makes a lot more sense here.
Also, Chromium and Firefox fail on invalid base64, so it's a logical
choice for PHP as well.
2016-07-22 18:03:55 +02:00
Lauri Kenttä f775199ac7 Require strict base64 in openssl_decode
Using invalid data in a security-related context makes no sense,
and there's even a test which depends on invalid base64 data failing,
even though it currently fails for the wrong reasons by sheer luck.
2016-07-22 18:03:55 +02:00
Lauri Kenttä 76f6f3583c Fix test: Use valid base64 even for invalid OpenSSL data 2016-07-22 18:03:55 +02:00
Nikita Popov dc04f2d2db Merge branch 'PHP-7.0' into PHP-7.1 2016-07-22 17:22:29 +02:00
Nikita Popov 7d77289717 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-22 17:22:13 +02:00
Nikita Popov 4fc1bfa93b Make IntlCalendar::getNow() test more tolerant
Due to the *1000 factor the two values may be off-by-1000 even
without any actual delay, so increase the check to 2000.
2016-07-22 17:20:56 +02:00
Xinchen Hui eaa8f49708 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
2016-07-22 23:15:24 +08:00
Xinchen Hui 6929121423 Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements) 2016-07-22 23:15:15 +08:00
Xinchen Hui 05dfd1d39f Update NEWs 2016-07-22 23:14:51 +08:00
Xinchen Hui df358a1c06 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
2016-07-22 23:14:28 +08:00
Xinchen Hui 516837344e Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements) 2016-07-22 23:13:42 +08:00
Christoph M. Becker a6953e70e5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-22 15:29:18 +02:00
Christoph M. Becker 9a2207c90a Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-22 15:27:55 +02:00
Christoph M. Becker 6b116932b2 Fix #72646: SplFileObject::getCsvControl does not return the escape character
This has obviously been missed when adding the $escape parameter to
SplFileObject::setCsvControl() in PHP 5.3, so we catch up on this.
2016-07-22 15:24:50 +02:00
Remi Collet d5ad4b8b14 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  FPM: add test for CVE-2016-5385
2016-07-22 09:37:00 +02:00
Remi Collet 9622f973a5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  FPM: add test for CVE-2016-5385
2016-07-22 09:36:36 +02:00
Remi Collet fb4a6dc0f1 FPM: add test for CVE-2016-5385 2016-07-22 09:35:09 +02:00
Christoph M. Becker 9c8b2c8689 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 18:53:42 +02:00
Christoph M. Becker 4472f9e822 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 18:39:27 +02:00
Christoph M. Becker f2c2a4be9e Fix #72330: CSV fields incorrectly split if escape char followed by UTF chars
We must not forget to properly reset the state for multibyte characters
following an escape character.
2016-07-21 18:37:24 +02:00
Christoph M. Becker 4c5aa9ba2c Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 16:51:19 +02:00
Christoph M. Becker 7e2c3a77c0 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 16:50:37 +02:00
Pieter Hordijk f813f43855 Removed incorrect (leftover?) sentence in ini
about mbstring or iconv output handler
2016-07-21 16:49:14 +02:00
Christoph M. Becker 8950fb42d9 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 16:33:06 +02:00
Christoph M. Becker bee362d5e3 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 16:31:16 +02:00
Pieter Hordijk 82bfb090ac Removed incorrect (leftover?) sentence in ini
about mbstring or iconv output handler
2016-07-21 16:28:48 +02:00
Davey Shafik a10d873cee Update NEWS for 7.1.0beta1 2016-07-21 01:56:38 -07:00
Remi Collet a2a122804e bump zip extension version 2016-07-21 08:44:26 +02:00
Remi Collet 7ac330d63a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  bump zip extension version
2016-07-21 08:43:49 +02:00
Remi Collet 61ce933d38 bump zip extension version 2016-07-21 08:42:53 +02:00
Xinchen Hui 8ec50677fa Update NEWS 2016-07-21 14:25:54 +08:00
Xinchen Hui bdd3f77be0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property)
2016-07-21 14:25:36 +08:00
Xinchen Hui 4a643e5e13 Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property) 2016-07-21 14:25:15 +08:00
Davey Shafik c9af9c78f1 Prepare NEWS for beta2 2016-07-20 20:07:35 -07:00
Anatol Belski a8b105b412 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update libs_version.txt
  update libs_versions.txt
2016-07-21 01:56:55 +02:00
Anatol Belski 7e1843fc04 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-07-21 01:55:42 +02:00
Anatol Belski e7168519dd update libs_version.txt 2016-07-21 01:54:53 +02:00
Anatol Belski 8b191921c3 update libs_versions.txt 2016-07-21 01:52:03 +02:00
Ferenc Kovacs f9ee0040e5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 00:38:11 +02:00
Ferenc Kovacs 027a82e4e6 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 00:37:41 +02:00
Ferenc Kovacs c9f21e8319 update NEWs 2016-07-21 00:36:07 +02:00
Davey Shafik 201c8438ad Update NEWS for RFC: Additional Context in pcntl_signal Handler 2016-07-20 14:48:15 -07:00
Davey Shafik 57092c5a68 Merge RFC Additional Context in pcntl_signal Handler 2016-07-20 14:17:04 -07:00
Jakub Zelenka 5507fbe6af Update NEWS with fixed OpenSSL 1.1 build 2016-07-20 19:34:30 +01:00
Jakub Zelenka e7ee24bf6d Merge branch 'openssl_1_1_port' 2016-07-20 19:32:07 +01:00
Christoph M. Becker f3a89ff075 Add test case for imagecopyresampled() with alpha 2016-07-20 19:26:29 +02:00
Anatol Belski be53fab51a Merge branch 'PHP-7.0'
* PHP-7.0:
  regenerate date parser with re2c 0.13.5 to fix OSX issues
2016-07-20 18:01:41 +02:00
Anatol Belski 462a9aa190 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  regenerate date parser with re2c 0.13.5 to fix OSX issues
2016-07-20 18:00:53 +02:00
Anatol Belski b57a38f584 regenerate date parser with re2c 0.13.5 to fix OSX issues 2016-07-20 17:57:39 +02:00
Anatol Belski c1ca3c5e6d Merge branch 'PHP-7.0'
* PHP-7.0:
  regenerate date parser with re2c 0.13.5
2016-07-20 13:37:17 +02:00
Anatol Belski 90c26fb6b1 regenerate date parser with re2c 0.13.5 2016-07-20 13:32:53 +02:00
Xinchen Hui 6e16ea4135 Fixed arginfo 2016-07-20 18:09:17 +08:00
Xinchen Hui d169fccae2 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed arginfo
2016-07-20 18:08:48 +08:00
Xinchen Hui e4af29b0b7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed arginfo
2016-07-20 18:07:18 +08:00
Xinchen Hui 9ebc96116b Fixed arginfo 2016-07-20 18:07:02 +08:00
Derick Rethans 533266127a Merge branch 'PHP-7.0' 2016-07-20 10:21:19 +01:00
Derick Rethans 1dafa806a9 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-20 10:21:03 +01:00
Derick Rethans 18ba78e988 Regenerate with the -b flag, as we used to do.
Apparently, Apple's LLVM can't handle it otherwise o_O.
2016-07-20 10:19:53 +01:00
Xinchen Hui 5296853fff Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed typo
2016-07-20 17:01:53 +08:00
Xinchen Hui cbbe17fb53 Fixed typo 2016-07-20 17:01:42 +08:00
Xinchen Hui f2fa45062e Update NEWs 2016-07-20 17:00:30 +08:00
Xinchen Hui 9254f5d5d3 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72629 (Caught exception assignment to variables ignores references).

Conflicts:
	main/php_version.h
2016-07-20 17:00:09 +08:00
Xinchen Hui 97c0b133c5 Fixed bug #72629 (Caught exception assignment to variables ignores references). 2016-07-20 16:59:14 +08:00
Xinchen Hui 07b869f367 Update NEWS 2016-07-20 16:13:21 +08:00
Xinchen Hui c35dab005c Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72622 (array_walk + array_replace_recursive create references from nothing)
2016-07-20 16:12:49 +08:00
Xinchen Hui 3c3b8c8365 Fixed bug #72622 (array_walk + array_replace_recursive create references from nothing) 2016-07-20 16:12:37 +08:00
Stanislav Malyshev dda0ea9b3a Merge branch 'PHP-7.0'
* PHP-7.0:
  Improve fix for #72520
  #72482, revert for 5.6 for now
2016-07-19 22:38:54 -07:00
Stanislav Malyshev df5ee7bc25 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Improve fix for #72520
  #72482, revert for 5.6 for now

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

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

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

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

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

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

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

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

Conflicts:
	configure.in
	main/php_version.h
2016-07-19 00:51:27 -07:00
Stanislav Malyshev f0a17b3a86 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
  fix #72519, possible OOB using imagegif
2016-07-19 00:44:08 -07:00
Anatol Belski 5c90f9b9cd Merge branch 'PHP-7.0'
* PHP-7.0:
  fix #72519, possible OOB using imagegif
2016-07-19 09:43:02 +02:00
Anatol Belski 905310d144 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
2016-07-19 09:42:28 +02:00
Anatol Belski 9bb5f64871 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
2016-07-19 09:40:26 +02:00
Pierre Joye 8dc5ffa479 fix #72519, possible OOB using imagegif 2016-07-19 00:37:53 -07:00
Pierre Joye 928aecc002 fix #72512, invalid read or write for palette image when invalid transparent index is used
Conflicts:
	ext/gd/libgd/gd.c
2016-07-19 00:37:38 -07:00
Pierre Joye 7b1572b177 fix #72519, possible OOB using imagegif
fix #72519, possible OOB using imagegif
2016-07-19 09:33:34 +02:00
Pierre Joye 2707271465 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:32 +07:00
Pierre Joye 05e8a0febe Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:20 +07:00
Pierre Joye b61bd1243a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
2016-07-19 14:16:01 +07:00
Stanislav Malyshev 33c1a55b40 Apparently some envs miss SIZE_MAX 2016-07-19 00:13:25 -07:00
Pierre Joye 2fbce5f51f fix #72519, possible OOB using imagegif 2016-07-19 14:11:44 +07:00
Pierre Joye 6434fc9d2b Merge branch 'PHP-7.0'
* PHP-7.0:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:44:11 +07:00
Pierre Joye 740661bd7a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:40:34 +07:00
Pierre Joye 511f07b747 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72512, invalid read or write for palette image when invalid transparent index is used
2016-07-19 13:39:46 +07:00
Pierre Joye 0fbcff1b35 fix #72512, invalid read or write for palette image when invalid transparent index is used 2016-07-19 13:37:23 +07:00
Stanislav Malyshev 08ac37bd2a Merge branch 'PHP-5.5.38' into PHP-5.5
* PHP-5.5.38:
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434
2016-07-18 23:32:38 -07:00
Stanislav Malyshev 1364742be9 Fix tests 2016-07-18 23:30:51 -07:00
Stanislav Malyshev 41131cd41d Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment 2016-07-18 23:21:51 -07:00
Stanislav Malyshev 5faa15c4ce Partial fix for bug #72613 - do not allow reading past error read 2016-07-18 23:01:36 -07:00
Stanislav Malyshev f3feddb5b4 Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t 2016-07-18 22:24:52 -07:00
Stanislav Malyshev e6c48213c2 Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c 2016-07-18 21:44:39 -07:00
Anatol Belski 88d86aeb53 add missing header to fix build 2016-07-19 01:30:07 +02:00
Christoph M. Becker 2f81707425 Merge branch 'PHP-7.0' 2016-07-19 00:55:13 +02:00
Christoph M. Becker d565d4bc1c Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/gd.c
2016-07-19 00:48:10 +02:00
Christoph M. Becker 3c3980caa1 Merge branch 'pull-request/1991' into PHP-5.6 2016-07-19 00:42:49 +02:00
Christoph M. Becker 6cb75fb1e8 Fix #70315: 500 Server Error but page is fully rendered
That happens because the external libgd uses other error codes than PHP
(and the bundled libgd), but the libgd error codes are simply forwarded
to php_verror(). We fix that by properly mapping libgd errors to PHP errors.
2016-07-19 00:18:07 +02:00
Nikita Popov d91e2e47d4 Increase array_rand() rehashing treshold
From 3/8 to 3/4. I was thinking in terms of nTableSize, where a
requirement > 1/2 is not tenable. However, we're actually working
with nNumUsed, in which case more than 1/4 tombstones should be
quite unusual.
2016-07-18 23:42:07 +02:00
Anatol Belski 7f3375d5f2 make constant name more descriptive 2016-07-18 23:33:22 +02:00
Nikita Popov f5452b2b46 Optimize the n=1 case of array_rand() 2016-07-18 23:14:39 +02:00
Anatol Belski 2170841e57 update NEWS and UPGRADING 2016-07-18 23:04:22 +02:00
Anatol Belski cb42fc347c fix regex decls and c89 compat 2016-07-18 22:28:04 +02:00
Leo Feyer 8f4050709c Support Unicode characters in the local part of an e-mail address.
See RFC 6531 (https://tools.ietf.org/html/rfc6531).

Encode IDNA domains.

Add the missing "Done" to the expected output.

Add the FILTER_FLAG_EMAIL_RFC6531 flag.

Fix the filter_var() call.
2016-07-18 21:52:35 +02:00
Stanislav Malyshev d1a491acf3 Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() 2016-07-18 00:17:48 -07:00
Stanislav Malyshev e4d55878dd Merge branch 'PHP-7.0.9' of git.php.net:php-src into PHP-7.0.9
* 'PHP-7.0.9' of git.php.net:php-src:
  update NEWS
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
2016-07-17 16:43:27 -07:00
Stanislav Malyshev eebcbd5de3 Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE 2016-07-17 16:34:21 -07:00
Nikita Popov 42260325a4 Fix optimization of $i = $i++ 2016-07-17 22:47:49 +02:00
Jakub Zelenka ea35d309b9 Update authors of openssl.c 2016-07-17 20:48:20 +01:00
Jakub Zelenka 6c497ad2d2 Use opaque EVP_PKEY for new EC logic in openssl_pkey_new 2016-07-17 20:44:33 +01:00
Jakub Zelenka 2ecce94756 Use opaque RSA, DSA and DH 2016-07-17 20:24:34 +01:00
Jakub Zelenka 329f74a11d Add missing creating of md_ctx in openssl_digest 2016-07-17 20:01:37 +01:00
Jakub Zelenka 444adff0b2 Change sign method from ecdsa-with-SHA1 to SHA1
There are no message digest methods for public key
(e.g. ecdsa-with-SHA1, dsa*, DSA*) MD methods in OpenSSL 1.1.
2016-07-17 17:46:14 +01:00
Jakub Zelenka e5780c8cd0 Add missing break in php_openssl_is_private_key 2016-07-17 17:46:14 +01:00
Jakub Zelenka 1008385959 Use SHA1 instead of DSS1 in test for bug #41033 2016-07-17 17:46:14 +01:00
Jakub Zelenka 069d20a33b Hide setting server ECDH curve for OpenSSL 1.1
It seems to be done automatically
2016-07-17 17:46:14 +01:00
Jakub Zelenka 1123c85d79 Do not use tmp_rsa_cb for OpenSSL 1.1
The SSL_CTX_set_tmp_rsa_callback has been removed
2016-07-17 17:46:14 +01:00
Jakub Zelenka 0afa0b1f83 The DSS1 is not available in OpenSSL 1.1 2016-07-17 17:46:13 +01:00
Jakub Zelenka 98514f96c9 Use opaque EVP_MD in phar_verify_signature 2016-07-17 17:43:35 +01:00
Jakub Zelenka d73735a750 Move and use opaque pkey in openssl_dh_compute_key 2016-07-17 17:43:34 +01:00
Jakub Zelenka 1a4e910e8d Use opaque pkey in openssl_pkey_get_details 2016-07-17 17:43:34 +01:00
Jakub Zelenka f08660bb58 Use EVP_PKEY_base_id where possible 2016-07-17 17:33:42 +01:00
Jakub Zelenka f1de72293e Use opaque EVP_PKEY in php_openssl_is_private_key 2016-07-17 17:33:42 +01:00
Jakub Zelenka 0598a8da2b Do not use X509 props directly in openssl_x509_parse 2016-07-17 17:33:42 +01:00
Jakub Zelenka e138b51dad Do not use X509_EXTENSION data directly as it is opaque 2016-07-17 17:33:42 +01:00
Jakub Zelenka 84a291d4da Wrap pkey id and rsa getters 2016-07-17 17:33:42 +01:00
Jakub Zelenka fd9142a647 Use opaque md ctx in openssl_sign and openssl_verify 2016-07-17 17:33:42 +01:00
Jakub Zelenka b8164673eb Use opaque cipher ctx in openssl_seal and openssl_open 2016-07-17 17:33:42 +01:00
Jakub Zelenka 3a8531e767 Use opaque EVP_MD_CTX in openssl_digest 2016-07-17 17:33:41 +01:00
Jakub Zelenka e1496f45fd Merge branch 'openssl_bump_to_1_0_1' 2016-07-17 17:28:08 +01:00
Jakub Zelenka 5a124e71ce Bump a minimal OpenSSL version to 1.0.1 2016-07-17 17:26:29 +01:00
Jakub Zelenka 5f569cc03e Bump minimal OpenSSL version to 1.0.1 2016-07-17 17:21:07 +01:00
Jakub Zelenka 839dc42f7e Merge branch 'openssl_drop_ssl2' 2016-07-17 17:14:38 +01:00
Jakub Zelenka a3a6436985 Update NEWS and UPGRADING with info about dropping SSL2 2016-07-17 17:13:24 +01:00
Leigh ab834f472f Merge RNG fixes RFC. PR #1986
* rng-fixes:
  Fix legacy mode RAND_RANGE and 32/64-bit consistency
  Fix crypt salt not being converted to b64
  Make mode selection part of mt_srand()
  Use zend_bitset
  Improve array_rand distribution
  Fix some insecure usages of php_rand
  Alias rand to mt_rand
  Fix RAND_RANGE for mt_rand
  Fix mt_rand impl. Provide legacy impl. access.
  Split rand and mt_rand into separate files
2016-07-17 16:05:10 +00:00
Remi Collet d30b6a85b2 force SSL_OP_NO_SSLv2 2016-07-17 16:41:47 +01:00
Remi Collet 642aee1deb Cleanup all SSLv2 code, whatever OpenSSL version is 2016-07-17 16:41:47 +01:00
Masaki Kagaya 69f468239b add test 2016-07-17 14:19:45 +02:00
Masaki Kagaya eb3e7f7c10 check the encoding of argument for mb_ereg, mb_ereg_replace, mb_ereg_search_init 2016-07-17 14:19:45 +02:00
Masaki Kagaya ee6ccea3eb add php_mb_check_encoding 2016-07-17 14:19:45 +02:00
Anatol Belski 2349332b66 correct macro names 2016-07-17 12:33:26 +02:00
Nikita Popov 735bec4f40 Avoid uncollectable cycle in sxe_property_get_adr
The code was storing the created object in a property on the
created object, creating a trivial cycle. This cycle cannot be
collected (even if sxe->tmp is exposed via get_gc), because it
is never rooted (and we cannot safely manually root it).

Change the code to store the created object on the parent node
instead.

The only reason this is not showing up as a leak is that sxe->tmp
is dtor'ed in the dtor handler, which means that these objects
do get collected on shutdown -- but never earlier.
2016-07-16 23:43:24 +02:00
Nikita Popov 2c51a2d00b Remove unnecessary use of sxe->tmp 2016-07-16 23:16:51 +02:00
Nikita Popov 29af302395 Remove useless dtor handlers in intl
These are only indirections to the default handler
2016-07-16 23:16:43 +02:00
Nikita Popov cbba1fff3f Fix leak if get_iterator throws but doesn't return NULL 2016-07-16 23:16:34 +02:00
Nikita Popov 9452257b04 Fix leak in PDO row_get_ctor
The __construct function name was leaked. Avoid this by simply
throwing directly from row_get_ctor instead of indirecting through
an actual __construct function.
2016-07-16 23:16:26 +02:00
Nikita Popov 267c525820 Fix leak in intl collator compare function 2016-07-16 23:16:20 +02:00
Nikita Popov 0242845536 Merge branch 'PHP-7.0' 2016-07-16 23:03:01 +02:00
Nikita Popov 31cbe23a9a Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_gc.c
2016-07-16 23:02:34 +02:00
Nikita Popov 171c759d79 Revert "Fixed bug #72286 (Segmentation fault During Garbage Collection)"
This reverts commit 1c84b55ade.
2016-07-16 23:02:23 +02:00
Leigh 027375d4c3 Fix legacy mode RAND_RANGE and 32/64-bit consistency 2016-07-16 16:50:20 +00:00
Christoph M. Becker 530f9666fe Un-XFAIL test case
libgd substitutes unallowed characters of XBM names (but not filenames),
depending on the locale. As we're interested in the filenames in this case
we simply ignore these differences.
2016-07-15 21:05:59 +02:00
Christoph M. Becker e6640b9902 Merge branch 'PHP-7.0' 2016-07-15 20:13:07 +02:00
Christoph M. Becker 190fbb94e7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-15 20:02:44 +02:00
Christoph M. Becker 3666cfab97 Fix #72604: imagearc() ignores thickness for full arcs
We remove the special casing for full arcs, what conforms to external libgd.
2016-07-15 19:45:52 +02:00
Christoph M. Becker ef0279b640 Merge branch 'PHP-7.0' 2016-07-15 01:22:26 +02:00
Christoph M. Becker b01b093ca9 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-15 01:14:41 +02:00
Christoph M. Becker a4aa4f9772 Fix bug #66502: DOM document dangling reference
When we decrement the refcount of a node's document, we state that we
won't need it anymore. Therefore we can *always* set the pointer to the
document to NULL, what avoids invalid memory accesses for some edge cases
as demonstrated with the PHPT.

Original patch provided by Sean Heelan.
2016-07-15 01:08:08 +02:00
Nikita Popov 32eaf7cdc1 Merge branch 'PHP-7.0' 2016-07-14 23:22:41 +02:00
Nikita Popov 0b0e7520a9 Fix test output
The error is now detected earlier, so the message ends up being
different.
2016-07-14 23:22:09 +02:00
Nikita Popov 664e5f392d Merge branch 'PHP-7.0' 2016-07-14 21:41:49 +02:00
Nikita Popov a50a5c1bf1 Fix is_callable() on abstract method via object 2016-07-14 21:41:41 +02:00
Dmitry Stogov 92e158e3c4 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72286 (Segmentation fault During Garbage Collection)
2016-07-14 22:39:15 +03:00
Dmitry Stogov 99a5170781 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72286 (Segmentation fault During Garbage Collection)
2016-07-14 22:38:47 +03:00
Dmitry Stogov 1c84b55ade Fixed bug #72286 (Segmentation fault During Garbage Collection) 2016-07-14 22:37:25 +03:00
Anatol Belski 0f5b5366a6 Merge branch 'master' of git.php.net:php-src 2016-07-14 21:21:35 +02:00
Anatol Belski d67e92af8a Merge branch 'PHP-7.0' of git.php.net:php-src into PHP-7.0 2016-07-14 21:21:01 +02:00
Anatol Belski 9565a081c4 Merge branch 'PHP-7.0'
* PHP-7.0:
  Extend libxml exports
  Updated NEWS
  Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
  Updated NEWS
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
  Update PHP 5.5 NEWS entries with CVE info
2016-07-14 21:17:40 +02:00
Anatol Belski d4b455ae3f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Extend libxml exports
  Updated NEWS
  Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
  Updated NEWS
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
  Update PHP 5.5 NEWS entries with CVE info
2016-07-14 21:16:07 +02:00
Anatol Belski d0c98366d0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Extend libxml exports
  Updated NEWS
  Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
  Updated NEWS
  Fix bug #70480 (php_url_parse_ex() buffer overflow read)
  Update PHP 5.5 NEWS entries with CVE info
2016-07-14 21:13:49 +02:00
Anatol Belski fe1d6feb3d Extend libxml exports
These are needed to support libxslt 1.1.29 on Windows. This libxslt version
fixes CVE-2015-7995 and for this reason needs to be used.
2016-07-14 21:08:54 +02:00
Nikita Popov 1e1ec122c6 Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 20:46:01 +02:00
Nikita Popov a26748d7be Fix bad merge
In master the operand is fetched earlier, I didn't account for
that.
2016-07-14 20:44:36 +02:00
Nikita Popov 37a2f3fe25 Fix leak if get_constructor returns NULL 2016-07-14 18:42:46 +02:00
Nikita Popov eba5466f10 Fix leaks if update_constant fails 2016-07-14 18:42:45 +02:00
Nikita Popov 0bda0422af Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 18:39:48 +02:00
Nikita Popov 411eee7b5a Fix leak when creating timezone with null bytes 2016-07-14 18:39:16 +02:00
Nikita Popov 00047fcf84 Fix leak when dynamically calling abstract method 2016-07-14 18:39:08 +02:00
Nikita Popov 587668be56 Fix leak of class name when printing exception backtrace 2016-07-14 18:38:58 +02:00
Nikita Popov c3804a2cf9 Fix leaks in yield from error conditions
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 18:38:45 +02:00
Nikita Popov d1f82bfeb2 Fix leak for by-ref assign to overloaded object
Conflicts:
	Zend/zend_vm_execute.h
2016-07-14 18:38:04 +02:00
Nikita Popov 82ce2a4e4d Add missing call opcodes in cleanup_unfinished_calls()
Otherwise we may leak if an exception is thrown from them.
2016-07-14 18:37:28 +02:00
Nikita Popov 5063b5aea1 Fix leak if throw_exception_object() fails 2016-07-14 18:37:21 +02:00
Christoph M. Becker 5aaffb7908 Merge branch 'PHP-7.0' 2016-07-14 17:31:03 +02:00
Christoph M. Becker 5829458215 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-14 17:25:13 +02:00
Christoph M. Becker 8bb3bd04a9 Fix bug #72596: imagetypes function won't advertise WEBP support
We add the constant IMG_WEBP and make sure that WebP support is properly
reported by imagetypes().
2016-07-14 17:17:59 +02:00
Nikita Popov e3e400c983 Fix return from by-ref generators 2016-07-14 15:44:04 +02:00
Anatol Belski 9d3b729803 update NEWS 2016-07-14 13:21:38 +02:00
Anatol Belski 918e40366d Merge branch 'PHP-7.0'
* PHP-7.0:
  update NEWS
2016-07-14 13:20:57 +02:00
Anatol Belski 131117f7a5 update NEWS 2016-07-14 13:20:13 +02:00
Dmitry Stogov 9a76189caf Fixed memory leak 2016-07-14 13:14:15 +03:00
Dmitry Stogov 61580460c8 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed memory leak
2016-07-14 13:12:34 +03:00
Matteo Beccati 0f182c2495 Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
Special commit for 7.0.9
2016-07-14 12:05:40 +02:00
Dmitry Stogov f80bb059b3 Fixed memory leak 2016-07-14 13:05:27 +03:00
Dmitry Stogov 8fc934b0a1 Fixed bug #71818 (Memory leak when array altered in destructor) 2016-07-14 12:05:44 +03:00
Xinchen Hui bb2bafc7d0 Update NEWS 2016-07-14 13:38:42 +08:00
Xinchen Hui efdc8ccd52 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals)

Conflicts:
	Zend/zend_compile.c
2016-07-14 13:38:27 +08:00
Xinchen Hui 8c5b27e061 Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals) 2016-07-14 13:36:43 +08:00
Nikita Popov a0e5ffae6f Merge branch 'PHP-7.0' 2016-07-13 21:58:00 +02:00
Nikita Popov 61a2566dc9 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-13 21:57:14 +02:00
Nikita Popov 3cc4265527 Add NEWS entry 2016-07-13 21:57:01 +02:00
Nikita Popov 981b94e0cf Merge branch 'PHP-7.0' 2016-07-13 21:52:40 +02:00
Nikita Popov 57c9983619 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/reflection/php_reflection.c
2016-07-13 21:48:05 +02:00
nikita2206 eb190b4e91 fix: bug72222 for PHP-5.6 reflection export of array consts 2016-07-13 21:39:55 +02:00
Dmitry Stogov e6f04d4c8e Unified behavior of modification of returned by reference value in finnally code. 2016-07-13 20:35:53 +03:00
Dmitry Stogov 02dca0cf16 Removed wrong warning 2016-07-13 20:04:47 +03:00
Dmitry Stogov afd3e39d66 Fixed bug #29368 (The destructor is called when an exception is thrown from the constructor). 2016-07-13 16:43:47 +03:00
Dmitry Stogov 3b8cb2119b Fixed bug #72347 (VERIFY_RETURN type casts visible in finally)
Fixed bug #72216 (Return by reference with finally is not memory safe)
Fixed bug #72215 (Wrong return value if var modified in finally)
2016-07-13 15:08:28 +03:00
Dmitry Stogov 0da7c08e39 Prevent wrong optimization 2016-07-13 15:05:11 +03:00
Anatol Belski fdc1f2e48f fix contirbutor name 2016-07-13 10:51:03 +02:00
Bob Weinand 517bbb14fd Disable optimizer when it conflicts with phpdbg tests 2016-07-13 10:22:00 +02:00
Stanislav Malyshev 3798eb6fd5 Fix bug #72562 - destroy var_hash properly 2016-07-12 23:27:45 -07:00
Stanislav Malyshev 3810e7b362 Fix bug #72551 and bug #72552 - check before converting size_t->int 2016-07-12 23:13:52 -07:00
Stanislav Malyshev 2ca8d85dd4 Fix bug #72541 - size_t overflow lead to heap corruption 2016-07-12 22:59:19 -07:00
Stanislav Malyshev aa82e99ed8 Fix bug #72533 (locale_accept_from_http out-of-bounds access) 2016-07-12 22:37:36 -07:00
Stanislav Malyshev 81406c0c1d Fix fir bug #72520 2016-07-12 22:05:00 -07:00
Stanislav Malyshev 0218acb7e7 Fix for bug #72513 2016-07-12 22:03:09 -07:00
Stanislav Malyshev a099545bec Fix for bug #72513 2016-07-12 21:52:27 -07:00
Stanislav Malyshev aca4f65c7e CS fix and comments with bug ID 2016-07-12 21:35:02 -07:00
Keyur 7ed028b108 Merge branch 'PHP-7.0' of https://git.php.net/push/php-src into PHP-7.0 2016-07-13 03:15:03 +00:00
Keyur a35512f162 Merge branch 'master' of https://git.php.net/push/php-src 2016-07-13 03:10:02 +00:00
Keyur ffa863e800 Merge branch 'PHP-7.0'
* PHP-7.0:
  Add to NEWS
  Fixes #72590: Opcache restart with kill_all_lockers does not work
2016-07-13 03:07:41 +00:00
Keyur 28e2f749e4 Add to NEWS 2016-07-13 03:03:26 +00:00
Keyur b512f4a956 Fixes #72590: Opcache restart with kill_all_lockers does not work
ACCEL_LOG_ERROR is special and causes a zend_bailout() and the code
never gets to call kill() in the next line after the logging. Change
the log level to WARNING.
2016-07-13 03:01:26 +00:00
Xinchen Hui 488a6cb33e Update NEWS 2016-07-13 10:51:11 +08:00
Xinchen Hui f24ed8c2fe Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML element)
2016-07-13 10:50:15 +08:00
Xinchen Hui 8129b83992 Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML element) 2016-07-13 10:49:58 +08:00
Bob Weinand 7a125a4409 Remove bogus zend_signal_shutdown symbol from header 2016-07-13 01:05:32 +02:00
Bob Weinand d08cb90462 Cleanup zend_/signal usage in phpdbg.c 2016-07-13 00:37:25 +02:00
Bob Weinand ef6d0c8b6d Fix phpdbg ZTS watchpoint+shutdown sequences & opcache+watchpoints 2016-07-12 20:50:51 +02:00
Keyur b31f8be143 Safer signal handler (no malloc() call) 2016-07-12 17:17:04 +02:00
Anatol Belski ff5228752f missed dot 2016-07-12 17:05:24 +02:00
Anatol Belski 9f6af81860 Merge branch 'PHP-7.0'
* PHP-7.0:
  missed the dot
2016-07-12 17:05:07 +02:00
Anatol Belski be77ce37fd missed the dot 2016-07-12 17:04:41 +02:00
Anatol Belski 4b1168d8b7 update NEWS 2016-07-12 17:02:39 +02:00
Anatol Belski 8c4f16a198 Merge branch 'PHP-7.0'
* PHP-7.0:
  update NEWS
2016-07-12 17:02:17 +02:00
Anatol Belski 3e6e590784 update NEWS 2016-07-12 17:01:51 +02:00
Julien Pauli f83b929d66 Updated NEWS 2016-07-12 15:55:01 +02:00
Julien Pauli 661b560c5f Merge branch 'PHP-7.0'
* PHP-7.0:
  Updated NEWS
  Updated NEWS
  Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
  Revert "Fix test for #52384"

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 15:54:39 +02:00
Julien Pauli 6173488110 Updated NEWS 2016-07-12 15:51:23 +02:00
Julien Pauli 152d53c844 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Revert "Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT."
  Revert "Fix test for #52384"

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

Conflicts:
	ext/pdo/pdo_stmt.c
2016-07-12 11:25:20 +02:00
Julien Pauli ca08ed417e Updated NEWS 2016-07-12 11:17:58 +02:00
Julien Pauli ec28576260 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fixes #52384: Adds parameter value to dumped output. Also adds output flag indicating presence of PDO::PARAM_INPUT_OUTPUT.

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

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

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

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

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

Conflicts:
	Zend/zend_exceptions.c
	ext/standard/tests/serialize/bug69152.phpt
2016-07-12 12:18:09 +08:00
Xinchen Hui 7903276f4c backport to 5.6 (we should not unset the default value) 2016-07-12 12:14:45 +08:00
Xinchen Hui 338ba17af0 Upate NEWS 2016-07-12 11:52:49 +08:00
Xinchen Hui 0478e431cf Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72581 (previous property undefined in Exception after deserialization)

Conflicts:
	Zend/zend_exceptions.c
2016-07-12 11:52:21 +08:00
Xinchen Hui 42902919bc Fixed bug #72581 (previous property undefined in Exception after deserialization) 2016-07-12 11:51:20 +08:00
Aaron Piotrowski 1ba20e311e Fix pcntl_signal_get_handler() test
Test was failing on Fedora.
2016-07-11 17:01:03 -05:00
Bob Weinand b00376884e Rewrite watchpoints to be much more stable
This mainly involves a separate abstraction layer for elements (e.g. $a->b) and watchpoints (on pointer of the Bucket for example).
Also better comparison handling (value backup vs. page dumps).

It is not yet finished (there are sometimes false positives announced and names not yet perfect), but the functionality is working and not crashing as far as I have tested.
Future scope is also relative watchpoints, e.g. "w $this->val expression()" which does not have the symbol tables as basis, but the value (in this example: return value of expression()) as basis.
2016-07-11 23:58:20 +02:00
Anatol Belski 1223f7f91b show libtidy version in the info, if available 2016-07-11 19:18:57 +02:00
Christoph M. Becker 15db83419d Update NEWS 2016-07-11 16:10:48 +02:00
Christoph M. Becker 90108a2f89 Merge branch 'PHP-7.0' 2016-07-11 16:10:15 +02:00
Christoph M. Becker 90e11e0c13 Update NEWS 2016-07-11 16:09:12 +02:00
Christoph M. Becker 23d4c9e6c7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-11 16:08:10 +02:00
Christoph M. Becker 966311e627 Bug #66836 has been fixed 2016-07-11 16:06:35 +02:00
Julien Pauli 51e7415575 Merge branch 'PHP-7.0'
* PHP-7.0:
  Remove needless zeroing of anonymously mmap'd memory
  Remove needless zeroing of anonymously mmap'd memory
2016-07-11 14:59:24 +02:00
Julien Pauli fc2c301fe2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Remove needless zeroing of anonymously mmap'd memory
  Remove needless zeroing of anonymously mmap'd memory
2016-07-11 14:58:55 +02:00
Julien Pauli 2552cf248d Remove needless zeroing of anonymously mmap'd memory 2016-07-11 14:58:12 +02:00
Michael McConville 9dd5d96332 Remove needless zeroing of anonymously mmap'd memory
All existing systems zero anonymously mmapped memory, and if I
understand correctly POSIX will be specifying this soon. Many projects
already rely on it, so no reasonable system would return memory of
unspecified value.
2016-07-11 14:56:17 +02:00
Anatol Belski 61a5e2ea74 update NEWS 2016-07-11 14:36:39 +02:00
Anatol Belski 54aae5d1ef fix config.w32 for new libtidy support 2016-07-11 14:05:43 +02:00
Michael Orlitzky 6319a35849 ext/tidy: work around a legacy libtidy bug in a test.
Our existing test 024.phpt actually tests incorrect behavior. There is
a self-closing tag present in the input, but the expected output has
that same tag half-open (i.e. open but never closed). To support
tidy-html5, which does the right thing, that test needed to be
changed. The self-closing tag was replaced by an explicit pair of
tags, and some extra whitespace fudging was done.
2016-07-11 14:05:43 +02:00
Michael Orlitzky a467a42dd1 ext/tidy: update the configuration file test to not inspect output.
One of the tests for tidy (016.phpt) is testing that we can use a
configuration file (016.tcfg) instead of a string to configure
tidy. It was observing the output of an API call, which proved too
fragile now that we support tidy-html5 as well. Instead, the test was
updated to inspect $tidy->getConfig() to ensure that the config file
was actually processed and will be respected.
2016-07-11 14:05:43 +02:00
Michael Orlitzky 846c72a3b8 ext/tidy: fix expected test output with tidy-html5.
One of the tidy tests expects some output that has (harmlessly)
changed in tidy-html5. The "EXPECT" block for that test was changed to
"EXPECTF" and mangled to accept both the old and new outputs.
2016-07-11 14:05:43 +02:00
Michael Orlitzky 08b10f17f1 ext/tidy: fix non-deterministic expected output in two tests.
Some of the tidy tests expect output that can change. The motivating
example is an object "id" that is some integer, but no integer in
particular. Those hard-coded values have been changed to accept any
integer so that the test suite passes when tidy-html5 is used.
2016-07-11 14:05:43 +02:00
Michael Orlitzky 0e3e132a8a ext/tidy: fix DOCTYPE definitions in expected test output.
The test suite for the tidy extension was written before HTML5 was
"standardized". The new tidy-html5 library will output an HTML5
DOCTYPE in the absence of any other information, so the expected test
outputs have been updated to accomodate the absense of an HTML version
(which is how you declare "HTML5").
2016-07-11 14:05:43 +02:00
Michael Orlitzky a552ac5bd5 ext/tidy: add support for the new tidy-html5 library.
Our existing libtidy support is based on the legacy "HTML tidy"
project. That project now has a successor called tidy-html5, where all
new features and bugfixes happen. Of particular note are the fixes for
two security vulnerabilities, CVE-2015-5522 and CVE-2015-5523.

The API is largely unchanged in the new project (which is truly the
successor of the original -- not a fork), and so it is almost a
drop-in replacement as far as PHP is concerned. However, one file has
changed in the new project: "buffio.h" has been moved to
"tidybuffio.h".

This commit detects the presence of tidybuffio.h at build time, and
then adjusts the import statement in tidy.c accordingly. The result is
a build that works against either the legacy project or the new
tidy-html5 project, although the test suite for the tidy extension now
fails. Those failures are not critical and will be fixed.

Gentoo-Bug: 561452
Gentoo-Bug: 585474
PHP-Bug: 72379
2016-07-11 14:05:43 +02:00
Christoph M. Becker 6a9d9cf272 Credit Scott, who authored the ext/mcrypt deprecation RFC 2016-07-11 13:41:01 +02:00
Julien Pauli c70f1fa6fb Update for NEWS 2016-07-11 13:30:46 +02:00
Christoph M. Becker a8e25877a2 Deprecate mcrypt and mdecrypt stream filters 2016-07-11 13:17:44 +02:00
Christoph M. Becker dadef20305 Fix tests according to changed deprecation message 2016-07-11 13:17:44 +02:00
Christoph M. Becker b6a6921371 Use PHP_DEP_FE instead of manually emitting deprecation warnings 2016-07-11 13:17:44 +02:00
Christoph M. Becker dda1c9a0f8 Fix missed test 2016-07-11 13:17:44 +02:00
Christoph M. Becker 3dd380c41e Implement RFC: Deprecate (then Remove) Mcrypt
<https://wiki.php.net/rfc/mcrypt-viking-funeral> has already been accepted,
so we implement it.
2016-07-11 13:17:44 +02:00
c9s 9288ce5390 Add document for zend_gc_collect_cycles 2016-07-11 12:44:42 +02:00
Derick Rethans 4fe37bb5d1 Merge branch 'PHP-7.0' 2016-07-11 11:32:22 +01:00
Derick Rethans 7759d6b0db Merge branch 'PHP-5.6' into PHP-7.0 2016-07-11 11:32:10 +01:00
Derick Rethans 6a5e1783b7 Generate new .c file from .re file, as that was missing on my previous commit 2016-07-11 11:31:43 +01:00
Anatol Belski 6442aac72f move the internal only info into UPGRADING.INTERNALS 2016-07-11 11:22:00 +02:00
Christoph M. Becker 0c98f51c84 Implement RFC "Deprecate mb_ereg_replace eval option"
<https://wiki.php.net/rfc/deprecate_mb_ereg_replace_eval_option> has been
accepted, so we implement it.
2016-07-11 11:20:01 +02:00
Anatol Belski cf8c217e8f add comment and fix typo 2016-07-11 11:17:34 +02:00
Anatol Belski 55ffabaa69 added UPGRADING and NEWS notes 2016-07-11 10:55:43 +02:00
Anatol Belski 45a8824423 fix build with mod_winnt 2016-07-11 09:40:43 +02:00
Martin Vobruba 2809a676b5 Pass error severity to SAPI modules and raise corresponding error level in Apache 2016-07-11 09:34:48 +02:00
Anatol Belski 2e3903b2d6 fix cli codepage reset 2016-07-11 09:24:41 +02:00
Anatol Belski 6955790107 silence compiler noise 2016-07-11 09:24:04 +02:00
Xinchen Hui 24d0211b32 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash)
2016-07-11 11:51:34 +08:00
Xinchen Hui a19655cfe3 Fixed bug #72571 (SQLite3::bindValue, SQLite3::bindParam crash) 2016-07-11 11:51:19 +08:00
Stanislav Malyshev 98b9dfaec9 Fix for HTTP_PROXY issue.
The following changes are made:
- _SERVER/_ENV only has HTTP_PROXY if the local environment has it,
  and only one from the environment.
- getenv('HTTP_PROXY') only returns one from the local environment
- getenv has optional second parameter, telling it to only consider
  local environment
2016-07-10 16:21:11 -07:00
Nikita Popov 5f6effed43 Add opcodes to zend_wrong_string_offset() 2016-07-10 15:15:34 +02:00
Matteo Beccati 445cb529b2 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders
  Fixed bug #70313 PDO statement fails to throw exception
2016-07-10 14:38:17 +02:00
Matteo Beccati 4d677ae0e2 Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders 2016-07-10 14:36:07 +02:00
Matteo Beccati 11d74b5b79 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #70313 PDO statement fails to throw exception
2016-07-10 14:34:59 +02:00
Matteo Beccati 219ebcb689 Fixed bug #70313 PDO statement fails to throw exception 2016-07-10 14:33:56 +02:00
Julien Pauli 2bdeec8396 Updated NEWS 2016-07-08 16:58:26 +02:00
Adam Saponara 74502d43be Ensure optind is correct when flags appear after dash-dash 2016-07-08 16:53:24 +02:00
Adam Saponara e4f7f00a77 Add optind param to getopt 2016-07-08 16:53:24 +02:00
Julien Pauli 6ab9b848e8 Updated NEWS 2016-07-08 16:34:15 +02:00
Julien Pauli 6f9405a058 Merge branch 'PHP-7.0'
* PHP-7.0:
  Updated NEWS
  Updated NEWS
  update filter_var filters for ipv4 addresses to reflect rfc6890
2016-07-08 16:32:42 +02:00
Julien Pauli 6725863993 Updated NEWS 2016-07-08 16:32:32 +02:00
Julien Pauli 13a5c54068 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  update filter_var filters for ipv4 addresses to reflect rfc6890
2016-07-08 16:31:53 +02:00
Julien Pauli 51d19891a4 Updated NEWS 2016-07-08 16:31:42 +02:00
Jos Elstgeest 6fc7817558 update filter_var filters for ipv4 addresses to reflect rfc6890 2016-07-08 16:30:06 +02:00
Julien Pauli 1097fe03a1 Merge branch 'PHP-7.0'
* PHP-7.0:
  Correct for connection with PDO::ATTR_STRINGIFY_FETCHES set to false
2016-07-08 15:55:22 +02:00
Adam Baratz 8db64e919c Correct for connection with PDO::ATTR_STRINGIFY_FETCHES set to false 2016-07-08 15:54:52 +02:00
Julien Pauli bdf1b22da5 Updated NEWS 2016-07-08 15:36:38 +02:00
Christoph M. Becker 82637e8187 Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
The SQL Server Native Client 11.0 and maybe other ODBC drivers report
NVARCHAR(MAX) columns as SQL_WVARCHAR with size 0. This causes too small a
buffer to be emalloc'd, likely causing a segfault in the following. As we don't
know the real size of the column data, we treat such colums as
SQL_WLONGVARCHAR.

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

(cherry picked from commit 16db4d1462)
(cherry picked from commit 344ff5dd4c)
2016-07-08 15:33:46 +02:00
Julien Pauli 26ccd8d1df Merge branch 'pull-request/1987'
* pull-request/1987:
  fix typo in configure message
2016-07-08 15:28:28 +02:00
Julien Pauli 09ea4a850a Updated NEWS 2016-07-08 15:25:28 +02:00
Christoph M. Becker 10e8248082 Implement #43269: Retrieve FD_SETSIZE within PHP
To give userland developers who work with large numbers of file descriptors
the opportunity to avoid problems on systems which may not support that
many descriptors (e.g. when calling socket_select()), we make FD_SETSIZE
available in PHP as PHP_FD_SETSIZE.
2016-07-08 15:23:15 +02:00
Julien Pauli 4b483cdc9a Merge branch 'PHP-7.0'
* PHP-7.0:
  Updated NEWS
  Updated NEWS
  Backported bug #71144 (Segmentation fault when using cURL with ZTS)
  fix bug #72024 (microtime() leaks memory)
2016-07-08 15:06:36 +02:00
Julien Pauli a8df121e18 Updated NEWS 2016-07-08 15:06:21 +02:00
Julien Pauli 87fe485c35 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Backported bug #71144 (Segmentation fault when using cURL with ZTS)
  fix bug #72024 (microtime() leaks memory)

Conflicts:
	ext/curl/interface.c
2016-07-08 15:05:13 +02:00
Julien Pauli 1071a2655f Updated NEWS 2016-07-08 15:04:13 +02:00
Julien Pauli 78d5783b62 Backported bug #71144 (Segmentation fault when using cURL with ZTS) 2016-07-08 14:58:56 +02:00
Michael Maroszek 0be13d2dc2 fix bug #72024 (microtime() leaks memory) 2016-07-08 14:36:44 +02:00
Julien Pauli 51b584b159 Updated NEWS 2016-07-08 14:35:43 +02:00
Julien Pauli 7377f45b61 Merge branch 'pull-request/1982' into PHP-5.5
* pull-request/1982:
  Update PHP 5.5 NEWS entries with CVE info
2016-07-08 14:24:05 +02:00
Remi Collet 720b085feb NEWS 2016-07-08 10:48:34 +02:00
Remi Collet 2303685a7e Merge branch 'PHP-7.0'
* PHP-7.0:
  NEWS
  Fixed Bug #72564 boolean always deserialized as "true"
  add test for bug #72564 (7.x regression)
2016-07-08 10:48:15 +02:00
Remi Collet 7ae00f08cf NEWS 2016-07-08 10:47:40 +02:00
Remi Collet 99d6e09c3d Fixed Bug #72564 boolean always deserialized as "true" 2016-07-08 10:46:33 +02:00
Remi Collet 76a143c27c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test for bug #72564 (7.x regression)
2016-07-08 10:45:32 +02:00
Remi Collet bfc42211d3 add test for bug #72564 (7.x regression) 2016-07-08 10:45:13 +02:00
David Walker cc16eff7ad Fix memory leak 2016-07-07 21:33:01 -06:00
David Walker f64388e8c1 pnctl_signal(): add siginfo to handler args
Feature will utilize already available siginfo parsing
and extend the handler for signals to provide an array
of the siginfo_t data.
RFC:https://wiki.php.net/rfc/additional-context-in-pcntl-signal-handler
2016-07-07 09:43:18 -06:00
Leigh be3640150c Fix crypt salt not being converted to b64 2016-07-07 15:32:38 +01:00
Leigh 69e7d8dcd5 Make mode selection part of mt_srand()
The mode of operation is intrinsically linked to seeding, so this makes a lot of sense
2016-07-07 15:14:06 +01:00
Leigh bb1f8228ed Use zend_bitset 2016-07-07 11:16:01 +01:00
Xinchen Hui d77a8b052b This became unnecessary after #72543 is fixed 2016-07-07 15:25:27 +08:00
Côme Bernigaud c53aadbba3 Merge branch 'pull-request/1955'
* pull-request/1955:
  Add parenthesis to if statements
  Correctly add to the length of the final string
  Correctly add to the length of the final string
  Fix minor spacing issue
  Make LDAP_ESCAPE_DN compliant with RFC 4514
2016-07-07 05:11:56 +02:00
Christopher Jones 5e4a5cfcd8 Merge branch 'PHP-7.0' 2016-07-07 11:53:08 +10:00
Christopher Jones fae6407314 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-07 11:52:39 +10:00
Christopher Jones 8b905e337c Mask DB usernames from expected test output for test portability 2016-07-07 11:52:17 +10:00
Ferenc Kovacs 1f811a965c Merge branch 'PHP-7.0' 2016-07-07 01:50:32 +02:00
Ferenc Kovacs 3580b9f8b6 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-07 01:49:05 +02:00
Ferenc Kovacs 2b7cd813e7 merge NEWS blocks 2016-07-07 01:46:02 +02:00
Ferenc Kovacs 0ca1698cf9 5.6.24RC1 2016-07-07 01:43:25 +02:00
Nikita Popov 406fbce997 Merge branch 'PHP-7.0' 2016-07-07 01:31:49 +02:00
Nikita Popov 06b6cb0ab0 Add NEWS entries 2016-07-07 01:31:04 +02:00
Lauri Kenttä 3104759915 base64_decode: fix bug #72264 ('VV= =' shouldn't fail in strict mode) 2016-07-07 01:27:23 +02:00
Lauri Kenttä 0259459486 base64_decode: remove redundant code
case 1 is already handled in the first lines of the for loop;
it would only be entered in the invalid case where the string
continues past the defined length (ch != 0 but length-- == 0).

case 2 and case 3 are redundant, since k >= j and later the
string is truncated to j characters anyway.
2016-07-07 01:27:23 +02:00
Lauri Kenttä c1ac081bf1 base64_decode: fix bug #72263 (skips char after padding) 2016-07-07 01:27:23 +02:00
Lauri Kenttä b9c9be13cc base64_decode: fix bug #72152 (fail on NUL bytes in strict mode)
This added check is actually for NOT failing in NON-strict mode.
The ch == -2 check later causes the desired failure in strict mode.
2016-07-07 01:27:23 +02:00
Lauri Kenttä ef6f163161 base64_decode: remove redundant check
If length == 0 || *current != '=' is false, the for loop will always
end up in this same point, until the if statement becomes true.
Thus, the if statement is not needed.
2016-07-07 01:27:23 +02:00
Lauri Kenttä c65de8ac13 base64_decode: reorder to fix out of bounds read 2016-07-07 01:27:22 +02:00
Ferenc Kovacs bb85a91f43 Merge branch 'PHP-7.0' 2016-07-07 01:18:19 +02:00
Ferenc Kovacs ea640e6117 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	configure.in
	main/php_version.h
2016-07-07 01:16:58 +02:00
Ferenc Kovacs c1280db28a 5.6.25 is next 2016-07-07 00:09:48 +02:00
Dmitry Stogov fbca255cd0 Fixed bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes) 2016-07-07 00:59:44 +03:00
Nikita Popov ab304579ff Forbid use of array() in nested destructuring
Previously array() was only forbidden on the outermost level.
2016-07-06 21:15:54 +02:00
Aaron Piotrowski 0e8fe163b0 Update NEWS and UPGRADING 2016-07-06 14:06:01 -05:00
David Walker ed9bff5352 oops, name test right 2016-07-06 13:57:37 -05:00
David Walker 90e326c620 change long to zend_long, for uniformity 2016-07-06 13:57:37 -05:00
David Walker fcda3c8ada Fix to not attempt to call if handler is long. Idea for this came
from comment on PR.
2016-07-06 13:57:37 -05:00
David Walker 217dcbcd91 Fix #72409 - return previous handler
This patch addresses https://bugs.php.net/bug.php?id=72409

This patch is applied to master compared to PR#1952 which was
patching 5.6.x branch of PHP

This patch takes into account discussions on PR #1978
Addressing that rather than have pcntl_signal() return a value
to create a new function that can be used to get the current
value of the signal handler.
2016-07-06 13:57:37 -05:00
Dmitry Stogov 023b812593 Fixed bug #72543 (Different references behavior comparing to PHP 5) 2016-07-06 20:46:43 +03:00
Adam Baratz ce4e1c0e15 fix typo in configure message 2016-07-06 10:36:19 -04:00
Leigh 06607993f6 Improve array_rand distribution 2016-07-06 12:35:13 +01:00
Derick Rethans cc89a46a89 Updated to version 2016.6 (2016f) 2016-07-06 11:15:46 +01:00
Derick Rethans ee22f79347 Empty merge 2016-07-06 11:15:46 +01:00
Derick Rethans a4e140e6ab Updated to version 2016.6 (2016f) 2016-07-06 11:15:45 +01:00
Derick Rethans 7008a36627 Empty merge 2016-07-06 11:15:44 +01:00
Derick Rethans 884db2f7be Updated to version 2016.6 (2016f) 2016-07-06 11:15:42 +01:00
Dmitry Stogov c03ccfe78d Asynchronous signal handling without TICKs.
Squashed commit of the following:

commit eda931df181060e202d2c664b4cba73a24afc6a1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jul 6 10:53:30 2016 +0300

    Replace pcntl.async_signals INI direcrive with pcntl_async_signals() function.

commit bfbf7dd7c2389ebada6c4464b276d9fa33fcfb60
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jun 24 12:25:31 2016 +0300

    Asynchronous signal handling without TICKs.
2016-07-06 13:11:47 +03:00
Anatol Belski b63d41e1e5 add tests for bug #72512 2016-07-06 10:40:52 +02:00
Matteo Beccati e2e72e1f5c Merge branch 'PHP-7.0'
* PHP-7.0:
  Rewrite test to avoid sending emails
2016-07-06 07:10:10 +02:00
Matteo Beccati ff7c981d19 Rewrite test to avoid sending emails
A properly configured email server was generating bounce emails when running
the test.
2016-07-06 07:08:43 +02:00
Aaron Piotrowski 210b6a2528 Update NEWS and UPGRADING with missed DBA changes 2016-07-05 16:09:21 -05:00
Davey Shafik 1ed53e8691 Bump versions 2016-07-05 12:33:37 -07:00
Davey Shafik c196cac71e Bump versions/dates for release of 7.1.0alpha3 2016-07-05 12:29:02 -07:00
Leigh b21de28bb7 Fix some insecure usages of php_rand 2016-07-05 16:02:34 +01:00
Leigh 6d6ef7aacc Alias rand to mt_rand 2016-07-05 15:09:49 +01:00
Anatol Belski 8bd8a64db6 fix possible optimization bug 2016-07-05 15:07:24 +02:00
Leigh 1f5cfea087 Fix RAND_RANGE for mt_rand 2016-07-05 12:13:38 +01:00
Leigh 7981a294bd Fix mt_rand impl. Provide legacy impl. access. 2016-07-05 11:54:07 +01:00
Leigh eba6e7ce9a Split rand and mt_rand into separate files 2016-07-05 11:16:37 +01:00
Stanislav Malyshev e1ba58f068 Fix bug #70480 (php_url_parse_ex() buffer overflow read)
(cherry picked from commit 629e4da7cc)
2016-07-05 10:59:02 +02:00
Anatol Belski a66cae883b set versions 2016-07-05 08:29:51 +02:00
Lior Kaplan ac56700125 Update PHP 5.5 NEWS entries with CVE info 2016-07-04 16:31:39 +02:00
Pierre Joye 7b2c22696a Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access 2016-07-04 10:35:20 +02:00
Chad Sikorra b1d82607e6 Add parenthesis to if statements 2016-06-29 07:37:48 -05:00
Stanislav Malyshev cab1c3b370 Fixed bug #72479 - same as #72434 2016-06-26 18:02:58 -07:00
Chad Sikorra f910ca259f Correctly add to the length of the final string 2016-06-26 17:29:07 -05:00
Chad Sikorra e85a2e360c Correctly add to the length of the final string 2016-06-26 17:10:51 -05:00
Chad Sikorra 737ee1f2c9 Fix minor spacing issue 2016-06-26 09:31:07 -05:00
Chad Sikorra 63427c1768 Make LDAP_ESCAPE_DN compliant with RFC 4514 2016-06-25 21:16:45 -05:00
758 changed files with 28468 additions and 17699 deletions

No files matched your search

+1 -1
View File
@@ -132,7 +132,7 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_oci
PRIMARY MAINTAINER: Unknown
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
+430
View File
@@ -1,5 +1,424 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
01 Sep 2016, PHP 7.1.0RC1
- Core:
. Fixed bug #72944 (Null pointer deref in zval_delref_p). (Dmitry)
. Fixed bug #72943 (assign_dim on string doesn't reset hval). (Laruence)
. Fixed bug #72598 (Reference is lost after array_slice()) (Nikita)
. Fixed bug #72703 (Out of bounds global memory read in BF_crypt triggered by
password_verify). (Anatol)
. Implement \ArgumentCountError when passing in too few arguments (Davey)
- COM:
. Fixed bug #72922 (COM called from PHP does not return out parameters).
(Anatol)
- Dba:
. Fixed bug #70825 (Cannot fetch multiple values with group in ini file).
(cmb)
- GD:
. Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor
images). (cmb)
. Fixed bug #72913 (imagecopy() loses single-color transparency on palette
images). (cmb)
. Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
- iconv:
. Fixed bug #72320 (iconv_substr returns false for empty strings). (cmb)
- Intl:
. Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
sequence). (cmb)
- JSON:
. Implemented earlier return when json_encode fails, fixes bugs #68992
(Stacking exceptions thrown by JsonSerializable) and #70275 (On recursion
error, json_encode can eat up all system memory). (Jakub Zelenka)
- mbstring:
. Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb)
- Opcache:
. Fixed bug #72949 (Typo in opcache error message). (cmb)
- PDO_DBlib:
. Implemented stringify 'uniqueidentifier' fields.
(Alexander Zhuravlev, Adam Baratz)
- Reflection:
. Reverted prepending \ for class names. (Trowski)
- Session:
. Fixed bug #72940 (SID always return "name=ID", even if session
cookie exist). (Yasuo)
. Implemented session_gc() and session_create_id() functions. (Yasuo)
- SimpleXML:
. Fixed bug #72971 (SimpleXML isset/unset do not respect namespace). (Nikita)
. Fixed bug #72957 (Null coalescing operator doesn't behave as expected with
SimpleXMLElement). (Nikita)
- SOAP:
. Fixed bug #71711 (Soap Server Member variables reference bug). (Nikita)
. Fixed bug #71996 (Using references in arrays doesn't work like expected).
(Nikita)
- Standard:
. Fixed bug #72920 (Accessing a private constant using constant() creates
an exception AND warning). (Laruence)
. Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign).
(cmb)
. Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory).
(cmb)
- XML:
. Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
18 Aug 2016, PHP 7.1.0beta3
- Core:
. Fixed bug #72813 (Segfault with __get returned by ref). (Laruence)
. Fixed bug #72767 (PHP Segfaults when trying to expand an infinite operator).
(Nikita)
. TypeError messages for arg_info type checks will now say "must be ...
or null" where the parameter or return type accepts null. (Andrea)
. Fixed bug #72857 (stream_socket_recvfrom read access violation). (Anatol)
. Fixed bug #72663 (Create an Unexpected Object and Don't Invoke
__wakeup() in Deserialization). (Stas)
. Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas)
. Fixed bug #72742 (memory allocator fails to realloc small block to large
one). (Stas)
. Fixed URL rewriter. It would not rewrite '//example.com/' URL
unconditionally. URL rewrite target hosts whitelist is implemented. (Yasuo)
- Bz2:
. Fixed bug #72837 (integer overflow in bzdecompress caused heap
corruption). (Stas)
- Curl
. Fixed bug #72674 (Heap overflow in curl_escape). (Stas)
- EXIF:
. Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
. Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas)
- FTP:
. Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with
require_ssl_reuse). (Benedict Singer)
- mbstring:
. Fixed bug #72711 (`mb_ereg` does not clear the `$regs` parameter on
failure). (ju1ius)
- Mcrypt:
. Fixed bug #72782 (Heap Overflow due to integer overflows). (Stas)
- OCI8
. Fixed invalid handle error with Implicit Result Sets. (Chris Jones)
. Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones)
- Opcache:
. Fixed bug #72762 (Infinite loop while parsing a file with opcache enabled).
(Nikita)
- PDO:
. Fixed bug #72788 (Invalid memory access when using persistent PDO
connection). (Keyur)
. Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur)
. Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY
returns false). (cmb)
- Reflection:
. Implemented request #38992 (invoke() and invokeArgs() static method calls
should match). (cmb).
. Add ReflectionNamedType::getName(). This method should be used instead of
ReflectionType::__toString()
. Prepend \ for class names and ? for nullable types returned from
ReflectionType::__toString(). (Trowski)
- Session:
. Implemented RFC: Session ID without hashing. (Yasuo)
https://wiki.php.net/rfc/session-id-without-hashing
- SPL:
. Fixed bug #72888 (Segfault on clone on splFileObject). (Laruence)
- SQLite3:
. Updated to SQLite3 3.14.0. (cmb)
- Standard:
. Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
Kenttä)
. Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
- Stream:
. Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)
. Fixed bug #72743 (Out-of-bound read in php_stream_filter_create).
(Loianhtuan)
. Implemented FR #27814 (Multiple small packets send for HTTP request).
(vhuk)
. Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails
with IIS FTP 7.5, 8.5). (vhuk)
. Fixed bug #72810 (Missing SKIP_ONLINE_TESTS checks). (vhuk)
- sysvshm:
. Fixed bug #72858 (shm_attach null dereference). (Anatol)
- XML:
. Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb)
- ZIP:
. Fixed bug #68302 (impossible to compile php with zip support). (cmb)
04 Aug 2016, PHP 7.1.0beta2
- Core:
. Implemented FR #72614 (Support "nmake test" on building extensions by
phpize). (Yuji Uchiyama)
. Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX).
(Yuji Uchiyama)
. Fixed bug #72683 (getmxrr broken). (Anatol)
- Calendar:
. Fixed bug #67976 (cal_days_month() fails for final month of the French
calendar). (cmb)
. Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in
zif_cal_from_jd). (cmb)
- CURL:
. Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
(Pierrick)
. Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
- Intl:
. Fixed bug #72639 (Segfault when instantiating class that extends
IntlCalendar and adds a property). (Laruence)
. Fixed bug #72658 (Locale::lookup() / locale_lookup() hangs if no match
found). (Anatol)
- GD:
. Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb)
. Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
. Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
- mbstring:
. Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
(cmb)
. Fixed bug #72693 (mb_ereg_search increments search position when a match
zero-width). (cmb)
. Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
position). (cmb)
. Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
(ju1ius)
- Mysqlnd:
. Fixed bug #71863 (Segfault when EXPLAIN with "Unknown column" error when
using MariaDB). (Andrey)
. Fixed bug #72701 (mysqli_get_host_info() wrong output). (Anatol)
- PCRE:
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
. Downgraded to PCRE 8.38. (Anatol)
- Reflection:
. Fixed bug #72661 (ReflectionType::__toString crashes with iterable).
(Laruence)
- SNMP:
. Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory
allocation). (djodjo at gmail dot com)
- SPL:
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
character). (cmb)
. Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick)
- SQLite3:
. Fixed bug #72668 (Spurious warning when exception is thrown in user defined
function). (Laruence)
. Implemented FR #72653 (SQLite should allow opening with empty filename).
(cmb)
- Standard:
. Fixed bug #61967 (unset array item in array_walk_recursive cause
inconsistent array). (Nikita)
. Fixed bug #62607 (array_walk_recursive move internal pointer). (Nikita)
. Fixed bug #69068 (Exchanging array during array_walk -> memory errors).
(Nikita)
. Fixed bug #70713 (Use After Free Vulnerability in array_walk()/
array_walk_recursive()). (Nikita)
- Streams:
. Fixed bug #41021 (Problems with the ftps wrapper). (vhuk)
. Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
. Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
non-existent directories). (vhuk)
. Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade
attack). (Stas)
- Wddx:
. Fixed bug #72142 (WDDX Packet Injection Vulnerability in
wddx_serialize_value()). (Taoguang Chen)
. Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas)
. Fixed bug #72750 (wddx_deserialize null dereference). (Stas)
. Fixed bug #72790 (wddx_deserialize null dereference with invalid xml).
(Stas)
. Fixed bug #72799 (wddx_deserialize null dereference in
php_wddx_pop_element). (Stas)
- XMLRPC:
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
array elements). (Laruence)
- Zip:
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
(Laruence)
21 Jul 2016, PHP 7.1.0beta1
- Core:
. Fixed bug #72629 (Caught exception assignment to variables ignores
references). (Laruence)
. Fixed bug #72594 (Calling an earlier instance of an included anonymous
class fatals). (Laruence)
. Fixed bug #72581 (previous property undefined in Exception after
deserialization). (Laruence)
. Fixed bug #72543 (Different references behavior comparing to PHP 5)
(Laruence, Dmitry, Nikita)
. Fixed bug #72347 (VERIFY_RETURN type casts visible in finally). (Dmitry)
. Fixed bug #72216 (Return by reference with finally is not memory safe).
(Dmitry)
. Fixed bug #72215 (Wrong return value if var modified in finally). (Dmitry)
. Fixed bug #71818 (Memory leak when array altered in destructor). (Dmitry)
. Fixed bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
(Dmitry, Nikita)
. Added new constant PHP_FD_SETSIZE. (cmb)
. Added optind parameter to getopt(). (as)
. Added PHP to SAPI error severity mapping for logs. (Martin Vobruba)
. Fixed bug #71911 (Unable to set --enable-debug on building extensions by
phpize on Windows). (Yuji Uchiyama)
. Fixed bug #29368 (The destructor is called when an exception is thrown from
the constructor). (Dmitry)
. Implemented RFC: RNG Fixes. (Leigh)
. Implemented email validation as per RFC 6531. (Leo Feyer, Anatol)
. Fixed bug #72513 (Stack-based buffer overflow vulnerability in
virtual_file_ex). (Stas)
. Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
and applications). (Stas)
- bz2:
. Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
- COM:
. Fixed bug #72569 (DOTNET/COM array parameters broke in PHP7). (Anatol)
- Curl:
. Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
- Date:
. Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
parsing). (derick)
- DOM:
. Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
- Exif:
. Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
(Stas)
. Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
(Stas)
- Filter:
. Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
range). (bugs dot php dot net at majkl578 dot cz)
- FPM:
. Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user).
(gooh)
- GD:
. Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb)
. Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb)
. Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb)
. Fixed bug #43828 (broken transparency of imagearc for truecolor in
blendingmode). (cmb)
. Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
access). (Pierre)
. Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
. Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
(Pierre)
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
overflow). (Pierre)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
- Intl:
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
names). (cmb)
. Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
- Mbstring:
. Deprecated mb_ereg_replace() eval option. (Rouven Weßling, cmb)
. Fixed bug #69151 (mb_ereg should reject ill-formed byte sequence).
(Masaki Kagaya)
- MCrypt:
. Deprecated ext/mcrypt. (Scott Arciszewski, cmb)
. Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
heap overflow in mdecrypt_generic). (Stas)
- Opcache:
. Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
(Keyur)
- OpenSSL:
. Fixed bug #72360 (ext/openssl build failure with OpenSSL 1.1.0).
(Jakub Zelenka)
. Bumped a minimal version to 1.0.1. (Jakub Zelenka)
. Dropped support for SSL2. (Remi)
- PDO_pgsql:
. Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
without placeholders). (Matteo)
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
specifying a sequence). (Pablo Santiago Sánchez, Matteo)
- Pcntl
. Implemented asynchronous signal handling without TICKS. (Dmitry)
. Added pcntl_signal_get_handler() that returns the current signal handler
for a particular signal. Addresses FR #72409. (David Walker)
. Add signinfo to pcntl_signal() handler args (Bishop Bettini, David Walker)
- Reflection:
. Fixed bug #72222 (ReflectionClass::export doesn't handle array constants).
(Nikita Nefedov)
- SimpleXML:
. Fixed bug #72588 (Using global var doesn't work while accessing SimpleXML
element). (Laruence)
- Standard:
. Fixed bug #72622 (array_walk + array_replace_recursive create references
from nothing). (Laruence)
. Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
UTF chars). (cmb)
- Tidy:
. Implemented support for libtidy 5.0.0 and above. (Michael Orlitzky, Anatol)
- Wddx:
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
- XMLRPC:
. Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
simplestring.c). (Stas)
- Zip:
. Fixed bug #72520 (Stack-based buffer overflow vulnerability in
php_stream_zip_opener). (Stas)
07 Jul 2016, PHP 7.1.0alpha3
- Core:
@@ -26,6 +445,11 @@ PHP NEWS
a fatal error. (Aaron Piotrowski)
. Export date_get_interface_ce() for extension use. (Jeremy Mikola)
- DBA:
. Data modification functions (e.g.: dba_insert()) now throw an instance of
Error instead of triggering a catchable fatal error if the key is does not
contain exactly two elements. (Aaron Piotrowski)
- DOM:
. Invalid schema or RelaxNG validation contexts will throw an instance of
Error instead of resulting in a fatal error. (Aaron Piotrowski)
@@ -100,11 +524,17 @@ PHP NEWS
. An invalid setting for session.hash_function will throw an instance of
Error instead of resulting in a fatal error when a session ID is created.
(Aaron Piotrowski)
. Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
Deserialization). (Stas)
- SimpleXML:
. Creating an unnamed or duplicate attribute will throw an instance of Error
instead of resulting in a fatal error. (Aaron Piotrowski)
- SNMP:
. Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
unserialize()). (Stas)
- SPL:
. Attempting to clone an SplDirectory object will throw an instance of Error
instead of resulting in a fatal error. (Aaron Piotrowski)
+17 -5
View File
@@ -208,15 +208,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
BYTE * psec_desc = NULL;
BOOL fAccess = FALSE;
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
PHP_WIN32_IOUTIL_INIT_W(pathname)
if (!pathw) {
return -1;
}
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
if (mode == 1 /*X_OK*/) {
DWORD type;
int ret;
@@ -673,6 +672,12 @@ TSRM_API int shmget(int key, int size, int flags)
}
} else {
if (flags & IPC_EXCL) {
if (shm_handle) {
CloseHandle(shm_handle);
}
if (info_handle) {
CloseHandle(info_handle);
}
return -1;
}
}
@@ -716,17 +721,24 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;
if (!shm->segment) {
return (void*)-1;
}
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
err = GetLastError();
if (err) {
SET_ERRNO_FROM_WIN32_CODE(err);
return (void*)-1;
}
shm->descriptor->shm_atime = time(NULL);
shm->descriptor->shm_lpid = getpid();
shm->descriptor->shm_nattch++;
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
return shm->addr;
}
+115 -2
View File
@@ -47,6 +47,35 @@ PHP 7.1 UPGRADE NOTES
syslog error levels. This brings finer differentiation in the error logs
in contrary to the previous approach where all the errors are loggged with
the notice level only.
. Don't call destructors of incompletely constructed objects, even if they
are kept referenced. See bug #29368 and Zend/tests/bug29368_1.phpt.
. call_user_func() will now consistently fail to perform calls to functions
that accept reference arguments. Previously this sometimes worked if
call_user_func() was used outside a namespace.
. rand() and srand() are now aliases of mt_rand() and mt_srand().
Consequently the output of the following functions has changed:
. rand()
. shuffle()
. str_shuffle()
. array_rand()
. Fixes to random number generators mean that mt_rand() now produces a
different sequence of outputs to previous versions. If you relied on
mt_srand() to produce a deterministic sequence, it can be called using
mt_srand($seed, MT_RAND_PHP) to produce old the sequences.
. URL rewriter has been improved.
. Use dedicated buffer for Session module rewrite and User rewrite.
. Full path URL rewrite is supported. Allowed domain can be specified.
$_SERVER['HTTP_HOST'] is allowed by default when host whitelist is empty.
. Use session.trans_sid_tags and session.trans_sid_hosts to control
session rewrite.
. Use url_rewriter.tags and url_rewriter.hosts to control user rewrite.
. <form>'s "action" attribute is used to check if URL rewrite is allowed
and listed under hosts whitelist.
. <fieldset> is no longer considered as a special tag. <form> is the
only tag considered special.
. Calling a function with less arguments than mandatory declared ones in
signature now issues a Fatal Error (Error Exception) instead of a Warning.
(RFC https://wiki.php.net/rfc/too_few_args).
- JSON:
. The serialize_precision is used instead of precision when encoding double
@@ -56,6 +85,49 @@ PHP 7.1 UPGRADE NOTES
. When calling json_encode with JSON_UNESCAPED_UNICODE option, U+2028 and
U+2029 are escaped.
- mbstring:
. mb_ereg() and mb_eregi() will now set the $regs argument to an empty array,
if nothing matched. Formerly, $regs was not modified in that case.
- OpenSSL:
. Dropped sslv2 stream.
- Session:
. Session ID is generated from CSPNG directly. As a result, Session ID length
could be any length between 22 and 256. Note: Max size of session ID depends
on save handler you are using.
. Following INIs are removed
. session.hash_function
. session.hash_bits_per_charactor
. session.entropy_file
. session.entropy_length
. New INIs and defaults
. session.sid_length (Number of session ID characters - 22 to 256.
(php.ini-* default: 26 Compitled default: 32)
. session.sid_bits_per_character (Bits used per character. 4 to 6.
php.ini-* default: 5 Compiled default: 4)
Length of old session ID string is determined as follows
. Used hash function's bits.
. session.hash_function=0 - MD5 128 bits (This was default)
. session.hash_function=1 - SHA1 192 bits
. Bits per character. (4, 5 or 6 bits per character)
. Examples
MD5 and 4 bits = 32 chars, ceil(128/4)=32
MD5 and 5 bits = 26 chars, ceil(128/5)=26
MD5 and 6 bits = 22 chars, ceil(128/6)=22
SHA1 and 4 bits = 48 chars, ceil(192/4)=48
SHA2 and 5 bits = 39 chars, ceil(192/5)=39
SHA1 and 6 bits = 32 chars, ceil(192/6)=32
and so on.
- Reflection:
. The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
aligned, what causes slightly different behavior than before for some
pathological cases.
. ReflectionType::__toString() will now return the type name with a leading
"?" if it is nullable. To retrieve the type name without leading "?" the new
ReflectionNamedType::getName() method can be used.
========================================
2. New Features
========================================
@@ -84,15 +156,29 @@ PHP 7.1 UPGRADE NOTES
++ and --, which have a unique approach to handling numeric strings.
(RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic)
. Closure::fromCallable (RFC: https://wiki.php.net/rfc/closurefromcallable)
. Added support for class constant visibility modifiers.
(RFC: https://wiki.php.net/rfc/class_const_visibility)
. TypeError messages for arg_info type checks will now say "must be ...
or null", or "must ... or be null" where the parameter or return type
accepts null. arg_info type checks are used by all userland functions with
type declarations, and some internal functions. Both nullable type
declarations (?int) and parameters with default values of null
(int $foo = NULL) are considered to "accept null" for this purpose.
========================================
3. Changes in SAPI modules
========================================
- apache2handler:
. Implemented per module logging.
. Implemented error level mapping between PHP and Apache for the error logs.
========================================
4. Deprecated Functionality
========================================
- 'e' option of mb_ereg_replace() and mb_eregi_replace().
- ext/mcrypt is now fully deprecated.
========================================
5. Changed Functions
========================================
@@ -124,6 +210,14 @@ PHP 7.1 UPGRADE NOTES
- substr_count() and mb_strimwidth() additionally also accept negative length.
- file_get_contents() accepts a negative seek offset if the stream is seekable.
- tempnam() throws a notice when failing back to the system temp dir.
- getopt() has an extra by-ref parameter : optind
- mb_ereg() and mb_ereg_replace() reject illegal byte sequences.
- FILTER_FLAG_EMAIL_UNICODE can be used with filter_var() for email validation
according to RFC 6531.
- output_reset_rewrite_vars() no longer reset session URL rewrite vars.
- the lasinsertid() in pdo_pgsql extension triggers an error, when no nextval()
were called in in the current session.
========================================
6. New Functions
@@ -132,6 +226,16 @@ PHP 7.1 UPGRADE NOTES
. Added sapi_windows_cp_set(), sapi_windows_cp_get(), sapi_windows_cp_is_utf8(),
sapi_windows_cp_conv() for codepage handling.
- cURL:
. Added curl_multi_errno() and curl_share_errno() to return the last error
number of curl_multi and curl_share resources.
. Added curl_share_strerror() to convert error code to error message text
describing the error.
- pcntl:
. Added pcntl_signal_get_handler() that returns the current signal handler
for a particular signal.
- Standard:
. Added is_iterable() that determines if a value will be accepted by the new
iterable pseudo-type.
@@ -156,6 +260,11 @@ PHP 7.1 UPGRADE NOTES
instance of Error from __wakeup() or __set_state() instead of resulting in
a fatal error.
- DBA:
. Data modification functions (e.g.: dba_insert()) now throw an instance of
Error instead of triggering a catchable fatal error if the key is does not
contain exactly two elements.
- DOM:
. Invalid schema or RelaxNG validation contexts will throw an instance of
Error instead of resulting in a fatal error.
@@ -204,8 +313,7 @@ PHP 7.1 UPGRADE NOTES
. Custom session handlers that do not return strings for session IDs will
now throw an instance of Error instead of resulting in a fatal error
when a function is called that must generate a session ID.
. An invalid setting for session.hash_function will throw an instance of
Error instead of resulting in a fatal error when a session ID is created.
. Only CSPRNG is used to generate session ID.
- SimpleXML:
. Creating an unnamed or duplicate attribute will throw an instance of Error
@@ -247,6 +355,9 @@ PHP 7.1 UPGRADE NOTES
10. New Global Constants
========================================
- Core:
. PHP_FD_SETSIZE
- JSON:
. JSON_UNESCAPED_LINE_TERMINATORS
@@ -300,6 +411,8 @@ PHP 7.1 UPGRADE NOTES
particular console program used. PHP automatically sets the console codepage
according to the encoding rules from php.ini. Using alternative consoles
instead of cmd.exe directly might bring better experience in some cases.
Nevertheless be aware, runtime codepage switch after the request start
might bring unexpected side effects on CLI. The preferrable way is php.ini.
As a result of UTF-8 support in the streams, PHP scripts are not limited
to ASCII or ANSI filenames anymore. This is supported out of the box on
+9
View File
@@ -4,6 +4,7 @@ PHP 7.1 INTERNALS UPGRADE NOTES
1. Internal API changes
e. Codepage handling on Windows
f. Path handling on Windows
g. SAPI logging
2. Build system changes
a. Unix build system changes
@@ -67,6 +68,12 @@ changes. See: https://wiki.php.net/phpng-upgrading
related functions. UTF-8 filenames are supported on any system disregarding
the system OEM/ANSI codepage.
g. SAPI logging
The log_message callback in the SAPI struct was extended with the severity
argument. This allows SAPI modules to implement mapping between PHP and
corresponding server error levels. A reference mapping implementation
can be found in apache2handler.
========================
2. Build system changes
@@ -75,6 +82,8 @@ changes. See: https://wiki.php.net/phpng-upgrading
a. Unix build system changes
b. Windows build system changes
Static analysis with clang and Cppcheck is supported by passing "clang" or
"cppcheck" keyword to the --with-analyzer configure option.
========================
3. Module changes
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #29368.1 (The destructor is called when an exception is thrown from the constructor).
--FILE--
<?php
function throwme($arg)
{
throw new Exception;
}
class foo {
function __construct() {
echo "Inside constructor\n";
throwme($this);
}
function __destruct() {
echo "Inside destructor\n";
}
}
try {
$bar = new foo;
} catch(Exception $exc) {
echo "Caught exception!\n";
}
?>
--EXPECT--
Inside constructor
Caught exception!
+1 -1
View File
@@ -44,7 +44,7 @@ Non-static method A::A_ftk() should not be called statically
2 %sbug38047.php:36 kalus_error_handler()
Fatal error: Uncaught Error: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
Stack trace:
#0 %sbug38047.php(36): A::A_ftk()
#1 {main}
+1 -1
View File
@@ -6,7 +6,7 @@ function f(callable $c) {}
f();
?>
--EXPECTF--
Fatal error: Uncaught Error: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
Stack trace:
#0 %s(%d): f()
#1 {main}
+1 -1
View File
@@ -19,7 +19,7 @@ try {
?>
--EXPECTF--
Fatal error: Uncaught Error: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
Stack trace:
#0 %sbug70689.php(12): foo()
#1 {main}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [];
$array[0] =& $array[''];
$array[0] = 42;
var_dump($array);
?>
--EXPECT--
array(2) {
[""]=>
&int(42)
[0]=>
&int(42)
}
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #71539.1 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$x = (object)['a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5,'f'=>6,'g'=>7];
$x->h =& $x->i;
$x->h = 42;
var_dump($x);
?>
--EXPECT--
object(stdClass)#1 (9) {
["a"]=>
int(1)
["b"]=>
int(2)
["c"]=>
int(3)
["d"]=>
int(4)
["e"]=>
int(5)
["f"]=>
int(6)
["g"]=>
int(7)
["i"]=>
&int(42)
["h"]=>
&int(42)
}
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #71539.2 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$a = [0,1,2,3,4,5,6];
$a[200] =& $a[100];
$a[100] =42;
var_dump($a);
?>
--EXPECT--
array(9) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(4)
[5]=>
int(5)
[6]=>
int(6)
[100]=>
&int(42)
[200]=>
&int(42)
}
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #71539.3 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [];
$array[0][0] =& $array[''];
$array[0][0] = 42;
var_dump($array);
?>
--EXPECT--
array(2) {
[""]=>
&int(42)
[0]=>
array(1) {
[0]=>
&int(42)
}
}
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #71539.4 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [0=>[]];
$array[0][0] =& $array[0][''];
$array[0][0] = 42;
var_dump($array);
?>
--EXPECT--
array(1) {
[0]=>
array(2) {
[""]=>
&int(42)
[0]=>
&int(42)
}
}
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$array = [];
$array['']->prop =& $array[0];
$array[0] = 42;
var_dump($array);
?>
--EXPECT--
array(2) {
[0]=>
&int(42)
[""]=>
object(stdClass)#1 (1) {
["prop"]=>
&int(42)
}
}
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
--FILE--
<?php
$name = 'a';
for ($i = 0; $i < 100000; $i++) {
if ($name != 'i') {
$$name =& $GLOBALS;
}
$name++;
}
?>
OK
--EXPECT--
OK
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #71818 (Memory leak when array altered in destructor)
--FILE--
<?php
class MemoryLeak
{
public function __construct()
{
$this->things[] = $this;
}
public function __destruct()
{
$this->things[] = null;
}
private $things = [];
}
ini_set('memory_limit', '10M');
for ($i = 0; $i < 100000; ++$i) {
$obj = new MemoryLeak();
}
echo "OK\n";
?>
--EXPECT--
OK
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72215 (Wrong return value if var modified in finally)
--FILE--
<?php
function test() {
$a = 1;
try {
return $a;
} finally {
$a = 2;
}
}
var_dump(test());
?>
--EXPECT--
int(1)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #72215.1 (Wrong return value if var modified in finally)
--FILE--
<?php
function &test(&$b) {
$a =& $b;
try {
return $a;
} finally {
$a = 2;
}
}
$x = 1;
$y =& test($x);
var_dump($y);
$x = 3;
var_dump($y);
?>
--EXPECT--
int(2)
int(3)
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #72215.1 (Wrong return value if var modified in finally)
--FILE--
<?php
function &test(&$b) {
$a =& $b;
try {
return $a;
} finally {
$a =& $c;
$a = 2;
}
}
$x = 1;
$y =& test($x);
var_dump($y);
$x = 3;
var_dump($y);
?>
--EXPECT--
int(1)
int(3)
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #72215.3 (Wrong return value if var modified in finally)
--FILE--
<?php
function &test() {
try {
return $a;
} finally {
$a = 2;
}
}
var_dump(test());
?>
--EXPECT--
int(2)
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72216 (Return by reference with finally is not memory safe)
--FILE--
<?php
function &test() {
$a = ["ok"];
try {
return $a[0];
} finally {
$a[""] = 42;
}
}
var_dump(test());
?>
--EXPECT--
string(2) "ok"
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72347 (VERIFY_RETURN type casts visible in finally)
--FILE--
<?php
function test() : int {
$d = 1.5;
try {
return $d;
} finally {
var_dump($d);
}
}
var_dump(test());
?>
--EXPECT--
float(1.5)
int(1)
+39
View File
@@ -0,0 +1,39 @@
--TEST--
Bug #72543 (different references behavior comparing to PHP 5)
--FILE--
<?php
function create_references(&$array) {
foreach ($array as $key => $value) {
create_references($array[$key]);
}
}
function change_copy($copy) {
$copy['b']['z']['z'] = $copy['b'];
}
$data = [
'a' => [
'b' => [],
],
];
create_references($data);
$copy = $data['a'];
var_dump($copy);
change_copy($copy);
var_dump($copy); //RECURSION
?>
--EXPECT--
array(1) {
["b"]=>
array(0) {
}
}
array(1) {
["b"]=>
array(0) {
}
}
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #72543.1 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [];
$arr[0] = null;
$ref =& $arr[0];
unset($ref);
$arr[0][0] = $arr[0];
var_dump($arr);
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
[0]=>
NULL
}
}
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #72543.2 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [];
$arr[0] = null;
$ref =& $arr[0];
unset($ref);
$arr[0][$arr[0]] = null;
var_dump($arr);
?>
--EXPECT--
array(1) {
[0]=>
array(1) {
[""]=>
NULL
}
}
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #72543.3 (different references behavior comparing to PHP 5)
--FILE--
<?php
$x = new stdClass;
$x->a = 1;
$ref =& $x->a;
unset($ref);
var_dump($x->a + ($x->a = 2));
?>
--EXPECT--
int(3)
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #72543.4 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [1];
$ref =& $arr[0];
unset($ref);
var_dump($arr[0] + ($arr[0] = 2));
?>
--EXPECT--
int(3)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #72543.5 (different references behavior comparing to PHP 5)
--FILE--
<?php
$arr = [1];
$ref =& $arr[0];
var_dump($arr[0] + ($arr[0] = 2));
?>
--EXPECT--
int(4)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72581 (previous property undefined in Exception after deserialization)
--FILE--
<?php
$e = new Exception('aaa', 200);
$a = serialize($e);
$b = unserialize($a);
var_dump($b->__toString());
?>
--EXPECTF--
string(%s) "Exception: aaa in %sbug72581.php:%d
Stack trace:
#0 {main}"
+33
View File
@@ -0,0 +1,33 @@
--TEST--
Bug #72594 (Calling an earlier instance of an included anonymous class fatals)
--INI--
opcache.enable=0
--FILE--
<?php
if (isset($runtime)) {
return new class {
public $bar;
public function bing($foo = null) {
if ($foo) $foo->bing();
}
};
}
$runtime = 1;
$oldFoo = require(__FILE__);
$newFoo = require(__FILE__);
var_dump(get_class_methods($oldFoo));
var_dump(get_object_vars($oldFoo));
$newFoo->bing($oldFoo);
?>
--EXPECTF--
array(1) {
[0]=>
string(4) "bing"
}
array(1) {
["bar"]=>
NULL
}
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #72598 (Reference is lost after array_slice())
--FILE--
<?php
function ref(&$ref) {
var_dump($ref);
}
new class {
function __construct() {
$args = [&$this];
for ($i = 0; $i < 2; $i++) {
$a = array_slice($args, 0, 1);
call_user_func_array('ref', $a);
}
}
};
?>
--EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
object(class@anonymous)#1 (0) {
}
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
object(class@anonymous)#1 (0) {
}
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #72598.2 (Reference is lost after array_slice())
--FILE--
<?php
function ref(&$ref) {
var_dump($ref);
$ref = 1;
}
new class {
function __construct() {
$b = 0;
$args = [&$b];
unset($b);
for ($i = 0; $i < 2; $i++) {
$a = array_slice($args, 0, 1);
call_user_func_array('ref', $a);
}
}
};
?>
--EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
int(0)
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
int(0)
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72767: PHP Segfaults when trying to expand an infinite operator
--FILE--
<?php
function test() {}
$iterator = new LimitIterator(
new InfiniteIterator(new ArrayIterator([42])),
0, 17000
);
test(...$iterator);
?>
===DONE===
--EXPECT--
===DONE===
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #72813 (Segfault with __get returned by ref)
--FILE--
<?php
class Test
{
private $props = ['a' => 'text', 'b' => 1];
public function &__get($prop)
{
return $this->props[$prop];
}
public function __set($prop, $value)
{
if ($prop === 'b') $value = [$value];
$this->props[$prop] = $value;
}
public function getProperties()
{
return [$this->props];
}
}
$obj = new Test;
$obj->b = $obj->b;
print_r($obj->getProperties());
?>
--EXPECT--
Array
(
[0] => Array
(
[a] => text
[b] => Array
(
[0] => 1
)
)
)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #72854: PHP Crashes on duplicate destructor call
--FILE--
<?php
function get() {
$t = new stdClass;
$t->prop = $t;
return $t;
}
$i = 42;
get()->prop =& $i;
?>
===DONE===
--EXPECT--
===DONE===
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
--FILE--
<?php
$a = 0;
$b = $a->b->i -= 0;
var_dump($b);
?>
--EXPECTF--
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
NULL
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #72943 (assign_dim on string doesn't reset hval)
--FILE--
<?php
$array = array("test" => 1);
$a = "lest";
var_dump($array[$a]);
$a[0] = "f";
var_dump($array[$a]);
$a[0] = "t";
var_dump($array[$a]);
?>
--EXPECTF--
Notice: Undefined index: lest in %sbug72943.php on line %d
NULL
Notice: Undefined index: fest in %sbug72943.php on line %d
NULL
int(1)
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #72944 (Null pointer deref in zval_delref_p).
--FILE--
<?php
"a"== e & $A = $A? 0 : 0 ?:0;
echo "OK\n";
?>
--EXPECTF--
Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
Notice: Undefined variable: A in %sbug72944.php on line 2
OK
+54
View File
@@ -0,0 +1,54 @@
--TEST--
call_user_func() behavior with references
--FILE--
<?php
function test(&$ref1, &$ref2) {
$ref1 += 42;
$ref2 -= 42;
return true;
}
$i = $j = 0;
var_dump(call_user_func('test', $i, $j));
var_dump($i, $j);
var_dump(call_user_func_array('test', [$i, $j]));
var_dump($i, $j);
$x =& $i; $y =& $j;
var_dump(call_user_func('test', $i, $j));
var_dump($i, $j);
var_dump(call_user_func_array('test', [$i, $j]));
var_dump($i, $j);
?>
--EXPECTF--
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
@@ -0,0 +1,20 @@
--TEST--
Call function with correct number of arguments
--FILE--
<?php
function foo() { }
foo();
function bar($foo, $bar) { }
bar(1, 2);
function bat(int $foo, string $bar) { }
bat(123, "foo");
bat("123", "foo");
$fp = fopen(__FILE__, "r");
fclose($fp);
echo "done";
--EXPECT--
done
@@ -0,0 +1,20 @@
--TEST--
Call function with correct number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
function foo() { }
foo();
function bar($foo, $bar) { }
bar(1, 2);
function bat(int $foo, string $bar) { }
bat(123, "foo");
$fp = fopen(__FILE__, "r");
fclose($fp);
echo "done";
--EXPECT--
done
@@ -0,0 +1,10 @@
--TEST--
Call internal function with incorrect number of arguments
--FILE--
<?php
substr("foo");
array_diff([]);
--EXPECTF--
Warning: substr() expects at least 2 parameters, 1 given in %s
Warning: array_diff(): at least 2 parameters are required, 1 given in %s
@@ -0,0 +1,18 @@
--TEST--
Call internal function with incorrect number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
try {
substr("foo");
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
array_diff([]);
--EXPECTF--
ArgumentCountError
substr() expects at least 2 parameters, 1 given
Warning: array_diff(): at least 2 parameters are required, 1 given in %s
@@ -0,0 +1,44 @@
--TEST--
Call userland function with incorrect number of arguments
--FILE--
<?php
try {
function foo($bar) { }
foo();
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
function bar($foo, $bar) { }
bar(1);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
function bat(int $foo, string $bar) { }
try {
bat(123);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
bat("123");
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
--EXPECTF--
ArgumentCountError
Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
ArgumentCountError
Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
@@ -0,0 +1,54 @@
--TEST--
Call userland function with incorrect number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
try {
function foo($bar) { }
foo();
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
function bar($foo, $bar) { }
bar(1);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
function bat(int $foo, string $bar) { }
try {
bat(123);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
bat("123");
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
bat(123, 456);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
--EXPECTF--
ArgumentCountError
Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
ArgumentCountError
Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
TypeError
Argument 1 passed to bat() must be of the type integer, string given, called in %s
TypeError
Argument 2 passed to bat() must be of the type string, integer given, called in %s
@@ -40,11 +40,10 @@ Stack trace:
#2 %s(%d): Generator->next()
#3 {main}
Generator 1
Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Caught exception!
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Stack trace:
#0 [internal function]: gen(Object(Generator))
#1 %s(%d): Generator->current()
#2 {main}
thrown in %s on line %d
NULL
@@ -0,0 +1,20 @@
--TEST--
Return from by-ref generator
--FILE--
<?php
function &gen() {
yield;
$arr = [42];
return $arr[0];
}
function gen2() {
var_dump(yield from gen());
}
gen2()->next();
?>
--EXPECT--
int(42)
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Cannot destructure using array(), even if nested
--FILE--
<?php
[array($a)] = [array(42)];
var_dump($a);
?>
--EXPECTF--
Fatal error: Cannot assign to array(), use [] instead in %s on line %d
+1 -1
View File
@@ -18,7 +18,7 @@ new bar(new \stdclass);
--EXPECTF--
NULL
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must be of the type array, object given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must be of the type array or null, object given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main}
+1 -1
View File
@@ -30,7 +30,7 @@ object(foo\test)#%d (0) {
}
NULL
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo, instance of stdClass given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo or be null, instance of stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main}
@@ -9,7 +9,7 @@ function f(?callable $p) {}
f();
--EXPECTF--
Fatal error: Uncaught Error: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
Stack trace:
#%d %s
#%d %s
+1 -1
View File
@@ -16,7 +16,7 @@ foo(0);
ok
ok
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, integer returned in %s030.php:3
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array or null, integer returned in %s030.php:3
Stack trace:
#0 %s030.php(10): foo(0)
#1 {main}
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Some string offset errors
--FILE--
<?php
function &test() : string {
$str = "foo";
return $str[0];
}
try {
test();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
$str = "foo";
$str[0] =& $str[1];
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Cannot return string offsets by reference
Cannot create references to/from string offsets
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72629 (Caught exception assignment to variables ignores references)
--FILE--
<?php
$var = null;
$e = &$var;
try {
throw new Exception;
} catch (Exception $e) { }
var_dump($var === $e);
--EXPECT--
bool(true)
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Fully-qualified nullable parameter type
--FILE--
<?php
namespace Foo;
function test(?\stdClass $param) {}
test(new \stdClass);
?>
===DONE===
--EXPECT--
===DONE===
+317
View File
@@ -0,0 +1,317 @@
--TEST--
Test "or null"/"or be null" in type-checking errors for userland functions
--FILE--
<?php
// This should test every branch in zend_execute.c's `zend_verify_arg_type`, `zend_verify_return_type` and `zend_verify_missing_return_type` functions which produces an "or null"/"or be null" part in its error message
function unloadedClass(?I\Dont\Exist $param) {}
try {
unloadedClass(new \StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
class RealClass {}
interface RealInterface {}
function loadedClass(?RealClass $param) {}
function loadedInterface(?RealInterface $param) {}
try {
loadedClass(new \StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
loadedInterface(new \StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
unloadedClass(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
loadedClass(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
loadedInterface(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function callableF(?callable $param) {}
try {
callableF(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function iterableF(?iterable $param) {}
try {
iterableF(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function intF(?int $param) {}
try {
intF(new StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnUnloadedClass(): ?I\Dont\Exist {
return new \StdClass;
}
try {
returnUnloadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedClass(): ?RealClass {
return new \StdClass;
}
try {
returnLoadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedInterface(): ?RealInterface {
return new \StdClass;
}
try {
returnLoadedInterface();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnUnloadedClassScalar(): ?I\Dont\Exist {
return 1;
}
try {
returnUnloadedClassScalar();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedClassScalar(): ?RealClass {
return 1;
}
try {
returnLoadedClassScalar();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedInterfaceScalar(): ?RealInterface {
return 1;
}
try {
returnLoadedInterfaceScalar();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnCallable(): ?callable {
return 1;
}
try {
returnCallable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnIterable(): ?iterable {
return 1;
}
try {
returnIterable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnInt(): ?int {
return new \StdClass;
}
try {
returnInt();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingUnloadedClass(): ?I\Dont\Exist {
}
try {
returnMissingUnloadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingLoadedClass(): ?RealClass {
}
try {
returnMissingLoadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingLoadedInterface(): ?RealInterface {
}
try {
returnMissingLoadedInterface();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingCallable(): ?callable {
}
try {
returnMissingCallable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingIterable(): ?iterable {
}
try {
returnMissingIterable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingInt(): ?int {
}
try {
returnMissingInt();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
?>
--EXPECTF--
TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, instance of stdClass given, called in %s on line 8 and defined in %s:5
Stack trace:
#0 %s(8): unloadedClass(Object(stdClass))
#1 {main}
TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, instance of stdClass given, called in %s on line 20 and defined in %s:16
Stack trace:
#0 %s(20): loadedClass(Object(stdClass))
#1 {main}
TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, instance of stdClass given, called in %s on line 26 and defined in %s:17
Stack trace:
#0 %s(26): loadedInterface(Object(stdClass))
#1 {main}
TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, integer given, called in %s on line 32 and defined in %s:5
Stack trace:
#0 %s(32): unloadedClass(1)
#1 {main}
TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, integer given, called in %s on line 38 and defined in %s:16
Stack trace:
#0 %s(38): loadedClass(1)
#1 {main}
TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, integer given, called in %s on line 44 and defined in %s:17
Stack trace:
#0 %s(44): loadedInterface(1)
#1 {main}
TypeError: Argument 1 passed to callableF() must be callable or null, integer given, called in %s on line 52 and defined in %s:49
Stack trace:
#0 %s(52): callableF(1)
#1 {main}
TypeError: Argument 1 passed to iterableF() must be iterable or null, integer given, called in %s on line 60 and defined in %s:57
Stack trace:
#0 %s(60): iterableF(1)
#1 {main}
TypeError: Argument 1 passed to intF() must be of the type integer or null, object given, called in %s on line 68 and defined in %s:65
Stack trace:
#0 %s(68): intF(Object(stdClass))
#1 {main}
TypeError: Return value of returnUnloadedClass() must be an instance of I\Dont\Exist or null, instance of stdClass returned in %s:74
Stack trace:
#0 %s(78): returnUnloadedClass()
#1 {main}
TypeError: Return value of returnLoadedClass() must be an instance of RealClass or null, instance of stdClass returned in %s:84
Stack trace:
#0 %s(88): returnLoadedClass()
#1 {main}
TypeError: Return value of returnLoadedInterface() must implement interface RealInterface or be null, instance of stdClass returned in %s:94
Stack trace:
#0 %s(98): returnLoadedInterface()
#1 {main}
TypeError: Return value of returnUnloadedClassScalar() must be an instance of I\Dont\Exist or null, integer returned in %s:104
Stack trace:
#0 %s(108): returnUnloadedClassScalar()
#1 {main}
TypeError: Return value of returnLoadedClassScalar() must be an instance of RealClass or null, integer returned in %s:114
Stack trace:
#0 %s(118): returnLoadedClassScalar()
#1 {main}
TypeError: Return value of returnLoadedInterfaceScalar() must implement interface RealInterface or be null, integer returned in %s:124
Stack trace:
#0 %s(128): returnLoadedInterfaceScalar()
#1 {main}
TypeError: Return value of returnCallable() must be callable or null, integer returned in %s:134
Stack trace:
#0 %s(138): returnCallable()
#1 {main}
TypeError: Return value of returnIterable() must be iterable or null, integer returned in %s:144
Stack trace:
#0 %s(148): returnIterable()
#1 {main}
TypeError: Return value of returnInt() must be of the type integer or null, object returned in %s:154
Stack trace:
#0 %s(158): returnInt()
#1 {main}
TypeError: Return value of returnMissingUnloadedClass() must be an instance of I\Dont\Exist or null, none returned in %s:164
Stack trace:
#0 %s(167): returnMissingUnloadedClass()
#1 {main}
TypeError: Return value of returnMissingLoadedClass() must be an instance of RealClass or null, none returned in %s:173
Stack trace:
#0 %s(176): returnMissingLoadedClass()
#1 {main}
TypeError: Return value of returnMissingLoadedInterface() must implement interface RealInterface or be null, none returned in %s:182
Stack trace:
#0 %s(185): returnMissingLoadedInterface()
#1 {main}
TypeError: Return value of returnMissingCallable() must be callable or null, none returned in %s:191
Stack trace:
#0 %s(194): returnMissingCallable()
#1 {main}
TypeError: Return value of returnMissingIterable() must be iterable or null, none returned in %s:200
Stack trace:
#0 %s(203): returnMissingIterable()
#1 {main}
TypeError: Return value of returnMissingInt() must be of the type integer or null, none returned in %s:209
Stack trace:
#0 %s(212): returnMissingInt()
#1 {main}
+23
View File
@@ -300,6 +300,9 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
ZEND_PUTS(")");
break;
}
case IS_REFERENCE:
zend_print_flat_zval_r(Z_REFVAL_P(expr));
break;
default:
zend_print_variable(expr);
break;
@@ -355,6 +358,9 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
case IS_LONG:
smart_str_append_long(buf, Z_LVAL_P(expr));
break;
case IS_REFERENCE:
zend_print_zval_r_to_buf(buf, Z_REFVAL_P(expr), indent);
break;
default:
{
zend_string *str = zval_get_string(expr);
@@ -1366,6 +1372,23 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
if (throw_exception) {
zend_throw_exception(zend_ce_argument_count_error, message, 0);
} else {
zend_error(E_WARNING, "%s", message);
}
efree(message);
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
{
#if ZEND_DEBUG
+1
View File
@@ -271,6 +271,7 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRI
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_COLD void zenderror(const char *error);
+14 -12
View File
@@ -157,7 +157,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
const char *space;
const char *class_name = get_active_class_name(&space);
zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
zend_internal_argument_count_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
}
/* }}} */
@@ -208,14 +208,16 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int num_
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
ZSTR_VAL(active_function->common.function_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
zend_internal_argument_count_error(
ZEND_ARG_USES_STRICT_TYPES(),
"%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
ZSTR_VAL(active_function->common.function_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
}
/* }}} */
@@ -875,7 +877,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_bool throw_exception = ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW);
zend_internal_type_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
zend_internal_argument_count_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
class_name,
class_name[0] ? "::" : "",
ZSTR_VAL(active_function->common.function_name),
@@ -3098,13 +3100,13 @@ get_function_via_handler:
if (retval) {
if (fcc->calling_scope && !call_via_handler) {
if (!fcc->object && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT) {
if (error) {
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
retval = 0;
} else {
zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fcc->calling_scope->name), ZSTR_VAL(fcc->function_handler->common.function_name));
return 0;
retval = 0;
}
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
int severity;
+12 -12
View File
@@ -1503,21 +1503,21 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
if (info & ZEND_MM_IS_SRUN) {
int old_bin_num, bin_num;
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
int old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
old_size = bin_data_size[old_bin_num];
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
if (size <= ZEND_MM_MAX_SMALL_SIZE) {
int bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
#if ZEND_DEBUG
dbg = zend_mm_get_debug_info(heap, ptr);
dbg->size = real_size;
dbg->filename = __zend_filename;
dbg->orig_filename = __zend_orig_filename;
dbg->lineno = __zend_lineno;
dbg->orig_lineno = __zend_orig_lineno;
dbg = zend_mm_get_debug_info(heap, ptr);
dbg->size = real_size;
dbg->filename = __zend_filename;
dbg->orig_filename = __zend_orig_filename;
dbg->lineno = __zend_lineno;
dbg->orig_lineno = __zend_orig_lineno;
#endif
return ptr;
return ptr;
}
}
} else /* if (info & ZEND_MM_IS_LARGE_RUN) */ {
ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE) == 0, "zend_mm_heap corrupted");
+118 -27
View File
@@ -584,7 +584,9 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *nam
void zend_stop_lexing(void)
{
if(LANG_SCNG(on_event)) LANG_SCNG(on_event)(ON_STOP, END, 0);
if (LANG_SCNG(on_event)) {
LANG_SCNG(on_event)(ON_STOP, END, 0, LANG_SCNG(on_event_context));
}
LANG_SCNG(yy_cursor) = LANG_SCNG(yy_limit);
}
@@ -2196,10 +2198,42 @@ static inline uint32_t zend_emit_jump(uint32_t opnum_target) /* {{{ */
}
/* }}} */
ZEND_API int zend_is_smart_branch(zend_op *opline) /* {{{ */
{
switch (opline->opcode) {
case ZEND_IS_IDENTICAL:
case ZEND_IS_NOT_IDENTICAL:
case ZEND_IS_EQUAL:
case ZEND_IS_NOT_EQUAL:
case ZEND_IS_SMALLER:
case ZEND_IS_SMALLER_OR_EQUAL:
case ZEND_CASE:
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
case ZEND_INSTANCEOF:
case ZEND_TYPE_CHECK:
case ZEND_DEFINED:
return 1;
default:
return 0;
}
}
/* }}} */
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
{
uint32_t opnum = get_next_op_number(CG(active_op_array));
zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL);
zend_op *opline;
if ((cond->op_type & (IS_CV|IS_CONST))
&& opnum > 0
&& zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) {
/* emit extra NOP to avoid incorrect SMART_BRANCH in very rare cases */
zend_emit_op(NULL, ZEND_NOP, NULL, NULL);
opnum = get_next_op_number(CG(active_op_array));
}
opline = zend_emit_op(NULL, opcode, cond, NULL);
opline->op2.opline_num = opnum_target;
return opnum;
}
@@ -2757,11 +2791,14 @@ void zend_compile_static_prop(znode *result, zend_ast *ast, uint32_t type, int d
static void zend_verify_list_assign_target(zend_ast *var_ast, zend_bool old_style) /* {{{ */ {
if (var_ast->kind == ZEND_AST_ARRAY) {
if (var_ast->attr == ZEND_ARRAY_SYNTAX_LONG) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot assign to array(), use [] instead");
}
if (old_style != var_ast->attr) {
zend_error(E_COMPILE_ERROR, "Cannot mix [] and list()");
zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix [] and list()");
}
} else if (!zend_can_write_to_variable(var_ast)) {
zend_error(E_COMPILE_ERROR, "Assignments can only happen to writable values");
zend_error_noreturn(E_COMPILE_ERROR, "Assignments can only happen to writable values");
}
}
/* }}} */
@@ -3026,7 +3063,20 @@ void zend_compile_assign_ref(znode *result, zend_ast *ast) /* {{{ */
offset = zend_delayed_compile_begin();
zend_delayed_compile_var(&target_node, target_ast, BP_VAR_W);
zend_delayed_compile_var(&source_node, source_ast, BP_VAR_W);
zend_compile_var(&source_node, source_ast, BP_VAR_W);
if ((target_ast->kind != ZEND_AST_VAR
|| target_ast->child[0]->kind != ZEND_AST_ZVAL)
&& source_node.op_type != IS_CV) {
/* Both LHS and RHS expressions may modify the same data structure,
* and the modification during RHS evaluation may dangle the pointer
* to the result of the LHS evaluation.
* Use MAKE_REF instruction to replace direct pointer with REFERENCE.
* See: Bug #71539
*/
zend_emit_op(&source_node, ZEND_MAKE_REF, &source_node, NULL);
}
zend_delayed_compile_end(offset);
if (source_node.op_type != IS_VAR && zend_is_call(source_ast)) {
@@ -4069,14 +4119,52 @@ static int zend_handle_loops_and_finally(znode *return_value) /* {{{ */
}
/* }}} */
static int zend_has_finally_ex(zend_long depth) /* {{{ */
{
zend_loop_var *base;
zend_loop_var *loop_var = zend_stack_top(&CG(loop_var_stack));
if (!loop_var) {
return 0;
}
base = zend_stack_base(&CG(loop_var_stack));
for (; loop_var >= base; loop_var--) {
if (loop_var->opcode == ZEND_FAST_CALL) {
return 1;
} else if (loop_var->opcode == ZEND_DISCARD_EXCEPTION) {
} else if (loop_var->opcode == ZEND_RETURN) {
/* Stack separator */
return 0;
} else if (depth <= 1) {
return 0;
} else {
depth--;
}
}
return 0;
}
/* }}} */
static int zend_has_finally(void) /* {{{ */
{
return zend_has_finally_ex(zend_stack_count(&CG(loop_var_stack)) + 1);
}
/* }}} */
void zend_compile_return(zend_ast *ast) /* {{{ */
{
zend_ast *expr_ast = ast->child[0];
zend_bool is_generator = (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0;
zend_bool by_ref = (CG(active_op_array)->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
znode expr_node;
zend_op *opline;
if (is_generator) {
/* For generators the by-ref flag refers to yields, not returns */
by_ref = 0;
}
if (!expr_ast) {
expr_node.op_type = IS_CONST;
ZVAL_NULL(&expr_node.u.constant);
@@ -4086,8 +4174,19 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
zend_compile_expr(&expr_node, expr_ast);
}
if ((CG(active_op_array)->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK)
&& (expr_node.op_type == IS_CV || (by_ref && expr_node.op_type == IS_VAR))
&& zend_has_finally()) {
/* Copy return value into temporary VAR to avoid modification in finally code */
if (by_ref) {
zend_emit_op(&expr_node, ZEND_MAKE_REF, &expr_node, NULL);
} else {
zend_emit_op_tmp(&expr_node, ZEND_QM_ASSIGN, &expr_node, NULL);
}
}
/* Generator return types are handled separately */
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
if (!is_generator && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
zend_emit_return_type_check(
expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1, 0);
}
@@ -4097,10 +4196,10 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN,
&expr_node, NULL);
if (expr_ast) {
if (by_ref && expr_ast) {
if (zend_is_call(expr_ast)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else if (by_ref && !zend_is_variable(expr_ast)) {
} else if (!zend_is_variable(expr_ast)) {
opline->extended_value = ZEND_RETURNS_VALUE;
}
}
@@ -4512,22 +4611,6 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
zend_compile_expr(&expr_node, expr_ast);
if (cases->children == 1 && cases->child[0]->child[0] == NULL) {
/* we have to take care about the case that only have one default branch,
* expr result will not be unrefed in this case, but it should be like in ZEND_CASE */
zend_ast *stmt_ast = cases->child[0]->child[1];
if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
zend_emit_op(NULL, ZEND_FREE, &expr_node, NULL);
} else if (expr_node.op_type == IS_CONST) {
zval_dtor(&expr_node.u.constant);
}
zend_begin_loop(ZEND_NOP, NULL);
zend_compile_stmt(stmt_ast);
zend_end_loop(get_next_op_number(CG(active_op_array)), NULL);
return;
}
zend_begin_loop(ZEND_FREE, &expr_node);
case_node.op_type = IS_TMP_VAR;
@@ -5089,6 +5172,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
arg_info->allow_null = has_null_default || is_explicitly_nullable;
type_ast->attr &= ~ZEND_TYPE_NULLABLE;
zend_compile_typename(type_ast, arg_info);
if (arg_info->type_hint == IS_VOID) {
@@ -5888,7 +5972,15 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
opline->opcode = ZEND_DECLARE_ANON_CLASS;
}
zend_hash_update_ptr(CG(class_table), lcname, ce);
if (!zend_hash_exists(CG(class_table), lcname)) {
zend_hash_add_ptr(CG(class_table), lcname, ce);
} else {
/* this anonymous class has been included */
zval zv;
ZVAL_PTR(&zv, ce);
destroy_zend_class(&zv);
return;
}
} else {
zend_string *key;
@@ -6175,7 +6267,6 @@ void zend_compile_group_use(zend_ast *ast) /* {{{ */
}
/* }}} */
void zend_compile_const_decl(zend_ast *ast) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
@@ -6480,7 +6571,7 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
uint32_t i;
zend_bool is_constant = 1;
if (ast->attr) {
if (ast->attr == ZEND_ARRAY_SYNTAX_LIST) {
zend_error(E_COMPILE_ERROR, "Cannot use list() as standalone expression");
}
+6 -1
View File
@@ -449,7 +449,7 @@ struct _zend_execute_data {
const zend_op *opline; /* executed opline */
zend_execute_data *call; /* current call */
zval *return_value;
zend_function *func; /* executed funcrion */
zend_function *func; /* executed function */
zval This; /* this + call_info + num_args */
zend_execute_data *prev_execute_data;
zend_array *symbol_table;
@@ -791,6 +791,7 @@ ZEND_API char *zend_make_compiled_string_description(const char *name);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
uint32_t zend_get_class_fetch_type(zend_string *name);
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc);
ZEND_API int zend_is_smart_branch(zend_op *opline);
typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
typedef struct _zend_auto_global {
@@ -841,6 +842,10 @@ ZEND_API void zend_assert_valid_class_name(const zend_string *const_name);
#define ZEND_TYPE_NULLABLE (1<<8)
#define ZEND_ARRAY_SYNTAX_LIST 1 /* list() */
#define ZEND_ARRAY_SYNTAX_LONG 2 /* array() */
#define ZEND_ARRAY_SYNTAX_SHORT 3 /* [] */
/* var status for backpatching */
#define BP_VAR_R 0
#define BP_VAR_W 1
+2
View File
@@ -375,12 +375,14 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
if (Z_TYPE_P(ret_constant) == IS_CONSTANT_AST) {
if (IS_CONSTANT_VISITED(ret_constant)) {
zend_throw_error(NULL, "Cannot declare self-referencing constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
ret_constant = NULL;
goto failure;
}
MARK_CONSTANT_VISITED(ret_constant);
}
if (UNEXPECTED(zval_update_constant_ex(ret_constant, ce) != SUCCESS)) {
RESET_CONSTANT_VISITED(ret_constant);
ret_constant = NULL;
goto failure;
}
RESET_CONSTANT_VISITED(ret_constant);
+9 -3
View File
@@ -36,6 +36,7 @@ ZEND_API zend_class_entry *zend_ce_error_exception;
ZEND_API zend_class_entry *zend_ce_error;
ZEND_API zend_class_entry *zend_ce_parse_error;
ZEND_API zend_class_entry *zend_ce_type_error;
ZEND_API zend_class_entry *zend_ce_argument_count_error;
ZEND_API zend_class_entry *zend_ce_arithmetic_error;
ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
@@ -303,9 +304,8 @@ ZEND_METHOD(exception, __construct)
/* {{{ proto Exception::__wakeup()
Exception unserialize checks */
#define CHECK_EXC_TYPE(id, type) \
ZVAL_UNDEF(&value); \
pvalue = zend_read_property_ex(i_get_exception_base(object), (object), CG(known_strings)[id], 1, &value); \
if(Z_TYPE_P(pvalue) != IS_UNDEF && Z_TYPE_P(pvalue) != type) { \
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
zval tmp; \
ZVAL_STR_COPY(&tmp, CG(known_strings)[id]); \
Z_OBJ_HANDLER_P(object, unset_property)(object, &tmp, NULL); \
@@ -532,6 +532,7 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
smart_str_appends(str, "Object(");
smart_str_appends(str, ZSTR_VAL(class_name));
smart_str_appends(str, "), ");
zend_string_release(class_name);
break;
}
}
@@ -709,7 +710,7 @@ ZEND_METHOD(exception, __toString)
ZVAL_UNDEF(&trace);
}
if (Z_OBJCE_P(exception) == zend_ce_type_error && strstr(ZSTR_VAL(message), ", called in ")) {
if ((Z_OBJCE_P(exception) == zend_ce_type_error || Z_OBJCE_P(exception) == zend_ce_argument_count_error) && strstr(ZSTR_VAL(message), ", called in ")) {
zend_string *real_message = zend_strpprintf(0, "%s and defined", ZSTR_VAL(message));
zend_string_release(message);
message = real_message;
@@ -859,6 +860,10 @@ void zend_register_default_exception(void) /* {{{ */
zend_ce_type_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_type_error->create_object = zend_default_exception_new;
INIT_CLASS_ENTRY(ce, "ArgumentCountError", NULL);
zend_ce_argument_count_error = zend_register_internal_class_ex(&ce, zend_ce_type_error);
zend_ce_argument_count_error->create_object = zend_default_exception_new;
INIT_CLASS_ENTRY(ce, "ArithmeticError", NULL);
zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_arithmetic_error->create_object = zend_default_exception_new;
@@ -1040,6 +1045,7 @@ ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
zend_throw_error(NULL, "Cannot throw objects that do not implement Throwable");
zval_ptr_dtor(exception);
return;
}
zend_throw_exception_internal(exception);
+1
View File
@@ -32,6 +32,7 @@ extern ZEND_API zend_class_entry *zend_ce_error_exception;
extern ZEND_API zend_class_entry *zend_ce_error;
extern ZEND_API zend_class_entry *zend_ce_parse_error;
extern ZEND_API zend_class_entry *zend_ce_type_error;
extern ZEND_API zend_class_entry *zend_ce_argument_count_error;
extern ZEND_API zend_class_entry *zend_ce_arithmetic_error;
extern ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
+257 -270
View File
@@ -131,7 +131,8 @@ ZEND_API const zend_internal_function zend_pass_function = {
((ZEND_VM_STACK_PAGE_SLOTS(gen) - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval))
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(gen, size) \
(((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
+ (ZEND_VM_STACK_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
zend_vm_stack page = (zend_vm_stack)emalloc(size);
@@ -566,6 +567,7 @@ 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);
@@ -575,8 +577,9 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
ref = Z_REF_P(value_ptr);
GC_REFCOUNT(ref)++;
zval_ptr_dtor(variable_ptr);
ZVAL_COPY_VALUE(&garbage, variable_ptr);
ZVAL_REF(variable_ptr, ref);
zval_ptr_dtor(&garbage);
}
/* this should modify object only if it's empty */
@@ -596,21 +599,18 @@ static inline int make_real_object(zval *object)
return 1;
}
static char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce)
static zend_class_entry *zend_verify_internal_arg_class_kind(
const zend_internal_arg_info *cur_arg_info)
{
zend_string *key;
zend_class_entry *ce;
ALLOCA_FLAG(use_heap);
ZSTR_ALLOCA_INIT(key, cur_arg_info->class_name, strlen(cur_arg_info->class_name), use_heap);
*pce = zend_fetch_class(key, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
ce = zend_fetch_class(key, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
ZSTR_ALLOCA_FREE(key, use_heap);
*class_name = (*pce) ? ZSTR_VAL((*pce)->name) : (char*)cur_arg_info->class_name;
if (*pce && (*pce)->ce_flags & ZEND_ACC_INTERFACE) {
return "implement interface ";
} else {
return "be an instance of ";
}
return ce;
}
static zend_always_inline zend_class_entry* zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info)
@@ -618,31 +618,102 @@ static zend_always_inline zend_class_entry* zend_verify_arg_class_kind(const zen
return zend_fetch_class(cur_arg_info->class_name, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
}
static ZEND_COLD void zend_verify_arg_error(const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind)
static ZEND_COLD void zend_verify_type_error_common(
const zend_function *zf, const zend_arg_info *arg_info,
const zend_class_entry *ce, zval *value,
const char **fname, const char **fsep, const char **fclass,
const char **need_msg, const char **need_kind, const char **need_or_null,
const char **given_msg, const char **given_kind)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname = ZSTR_VAL(zf->common.function_name);
const char *fsep;
const char *fclass;
zend_bool is_interface = 0;
*fname = ZSTR_VAL(zf->common.function_name);
if (zf->common.scope) {
fsep = "::";
fclass = ZSTR_VAL(zf->common.scope->name);
*fsep = "::";
*fclass = ZSTR_VAL(zf->common.scope->name);
} else {
fsep = "";
fclass = "";
*fsep = "";
*fclass = "";
}
if (zf->common.type == ZEND_USER_FUNCTION) {
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d",
arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind,
ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
switch (arg_info->type_hint) {
case IS_OBJECT:
if (ce) {
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
*need_msg = "implement interface ";
is_interface = 1;
} else {
*need_msg = "be an instance of ";
}
*need_kind = ZSTR_VAL(ce->name);
} else {
/* We don't know whether it's a class or interface, assume it's a class */
*need_msg = "be an instance of ";
*need_kind = zf->common.type == ZEND_INTERNAL_FUNCTION
? ((zend_internal_arg_info *) arg_info)->class_name
: ZSTR_VAL(arg_info->class_name);
}
break;
case IS_CALLABLE:
*need_msg = "be callable";
*need_kind = "";
break;
case IS_ITERABLE:
*need_msg = "be iterable";
*need_kind = "";
break;
default:
*need_msg = "be of the type ";
*need_kind = zend_get_type_by_const(arg_info->type_hint);
break;
}
if (arg_info->allow_null) {
*need_or_null = is_interface ? " or be null" : " or null";
} else {
*need_or_null = "";
}
if (value) {
if (arg_info->type_hint == IS_OBJECT && Z_TYPE_P(value) == IS_OBJECT) {
*given_msg = "instance of ";
*given_kind = ZSTR_VAL(Z_OBJCE_P(value)->name);
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
*given_msg = zend_zval_type_name(value);
*given_kind = "";
}
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
*given_msg = "none";
*given_kind = "";
}
}
static ZEND_COLD void zend_verify_arg_error(
const zend_function *zf, const zend_arg_info *arg_info,
int arg_num, const zend_class_entry *ce, zval *value)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname, *fsep, *fclass;
const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
if (value) {
zend_verify_type_error_common(
zf, arg_info, ce, value,
&fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
if (zf->common.type == ZEND_USER_FUNCTION) {
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given, called in %s on line %d",
arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind,
ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
} else {
zend_missing_arg_error(ptr);
}
}
@@ -724,11 +795,50 @@ static zend_bool zend_verify_scalar_type_hint(zend_uchar type_hint, zval *arg, z
return zend_verify_weak_scalar_type_hint(type_hint, arg);
}
static zend_always_inline zend_bool zend_check_internal_type(
const zend_function *zf, const zend_internal_arg_info *arg_info,
zval *arg, zend_class_entry **ce, zend_bool is_return_type)
{
if (!arg_info->type_hint) {
return 1;
}
ZVAL_DEREF(arg);
if (EXPECTED(arg_info->type_hint == Z_TYPE_P(arg))) {
if (arg_info->class_name) {
*ce = zend_verify_internal_arg_class_kind(arg_info);
return *ce && instanceof_function(Z_OBJCE_P(arg), *ce);
}
return 1;
}
if (Z_TYPE_P(arg) == IS_NULL && arg_info->allow_null) {
return 1;
}
if (arg_info->class_name) {
*ce = zend_verify_internal_arg_class_kind(arg_info);
return 0;
} else if (arg_info->type_hint == IS_CALLABLE) {
return zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL);
} else if (arg_info->type_hint == IS_ITERABLE) {
return zend_is_iterable(arg);
} else if (arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
return 1;
} else if (is_return_type) {
/* Internal return types are always strict */
return 0;
} else {
/* Internal parameter types honor strict_types */
return zend_verify_scalar_type_hint(arg_info->type_hint, arg, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)));
}
}
static int zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg)
{
zend_internal_arg_info *cur_arg_info;
char *need_msg, *class_name;
zend_class_entry *ce;
const zend_internal_arg_info *cur_arg_info;
zend_class_entry *ce = NULL;
if (EXPECTED(arg_num <= zf->internal_function.num_args)) {
cur_arg_info = &zf->internal_function.arg_info[arg_num-1];
@@ -738,40 +848,11 @@ static int zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zv
return 1;
}
if (cur_arg_info->type_hint) {
ZVAL_DEREF(arg);
if (EXPECTED(cur_arg_info->type_hint == Z_TYPE_P(arg))) {
if (cur_arg_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce);
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce)) {
zend_verify_arg_error(zf, arg_num, need_msg, class_name, "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
return 0;
}
}
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
if (cur_arg_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce);
zend_verify_arg_error(zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "");
return 0;
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL)) {
zend_verify_arg_error(zf, arg_num, "be callable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(arg)) {
zend_verify_arg_error(zf, arg_num, "be iterable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
/* pass */
} else if (UNEXPECTED(!zend_verify_scalar_type_hint(cur_arg_info->type_hint, arg, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data))))) {
zend_verify_arg_error(zf, arg_num, "be of the type ", zend_get_type_by_const(cur_arg_info->type_hint), zend_zval_type_name(arg), "");
return 0;
}
}
if (UNEXPECTED(!zend_check_internal_type(zf, cur_arg_info, arg, &ce, 0))) {
zend_verify_arg_error(zf, (const zend_arg_info *) cur_arg_info, arg_num, ce, arg);
return 0;
}
return 1;
}
@@ -792,10 +873,69 @@ static zend_never_inline int zend_verify_internal_arg_types(zend_function *fbc,
return 1;
}
static zend_always_inline zend_bool zend_check_type(
const zend_function *zf, const zend_arg_info *arg_info,
zval *arg, zend_class_entry **ce, void **cache_slot,
zval *default_value, zend_bool is_return_type)
{
if (!arg_info->type_hint) {
return 1;
}
ZVAL_DEREF(arg);
if (EXPECTED(arg_info->type_hint == Z_TYPE_P(arg))) {
if (arg_info->class_name) {
if (EXPECTED(*cache_slot)) {
*ce = (zend_class_entry *) *cache_slot;
} else {
*ce = zend_verify_arg_class_kind(arg_info);
if (UNEXPECTED(!*ce)) {
return 0;
}
*cache_slot = (void *) *ce;
}
if (UNEXPECTED(!instanceof_function(Z_OBJCE_P(arg), *ce))) {
return 0;
}
}
return 1;
}
if (Z_TYPE_P(arg) == IS_NULL && (arg_info->allow_null || (default_value && is_null_constant(zf->common.scope, default_value)))) {
/* Null passed to nullable type */
return 1;
}
if (UNEXPECTED(arg_info->class_name)) {
/* This is always an error - we fetch the class name for the error message here */
if (EXPECTED(*cache_slot)) {
*ce = (zend_class_entry *) *cache_slot;
} else {
*ce = zend_verify_arg_class_kind(arg_info);
if (*ce) {
*cache_slot = (void *) *ce;
}
}
return 0;
} else if (arg_info->type_hint == IS_CALLABLE) {
return zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL);
} else if (arg_info->type_hint == IS_ITERABLE) {
return zend_is_iterable(arg);
} else if (arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
return 1;
} else {
return zend_verify_scalar_type_hint(arg_info->type_hint, arg,
is_return_type ? ZEND_RET_USES_STRICT_TYPES() : ZEND_ARG_USES_STRICT_TYPES());
}
/* Special handling for IS_VOID is not necessary (for return types),
* because this case is already checked at compile-time. */
}
static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot)
{
zend_arg_info *cur_arg_info;
char *need_msg;
zend_class_entry *ce;
if (EXPECTED(arg_num <= zf->common.num_args)) {
@@ -806,68 +946,11 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
return 1;
}
if (cur_arg_info->type_hint) {
ZVAL_DEREF(arg);
if (EXPECTED(cur_arg_info->type_hint == Z_TYPE_P(arg))) {
if (cur_arg_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(cur_arg_info);
if (UNEXPECTED(!ce)) {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
return 0;
}
*cache_slot = (void*)ce;
}
if (UNEXPECTED(!instanceof_function(Z_OBJCE_P(arg), ce))) {
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_arg_error(zf, arg_num, need_msg, ZSTR_VAL(ce->name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
return 0;
}
}
} else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(zf->common.scope, default_value)))) {
if (cur_arg_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(cur_arg_info);
if (UNEXPECTED(!ce)) {
if (Z_TYPE_P(arg) == IS_OBJECT) {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
} else {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg));
}
return 0;
}
*cache_slot = (void*)ce;
}
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_arg_error(zf, arg_num, need_msg, ZSTR_VAL(ce->name), zend_zval_type_name(arg), "");
return 0;
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL)) {
zend_verify_arg_error(zf, arg_num, "be callable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(arg)) {
zend_verify_arg_error(zf, arg_num, "be iterable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
/* pass */
} else if (UNEXPECTED(!zend_verify_scalar_type_hint(cur_arg_info->type_hint, arg, ZEND_ARG_USES_STRICT_TYPES()))) {
zend_verify_arg_error(zf, arg_num, "be of the type ", zend_get_type_by_const(cur_arg_info->type_hint), zend_zval_type_name(arg), "");
return 0;
}
}
if (UNEXPECTED(!zend_check_type(zf, cur_arg_info, arg, &ce, cache_slot, default_value, 0))) {
zend_verify_arg_error(zf, cur_arg_info, arg_num, ce, arg);
return 0;
}
return 1;
}
@@ -876,7 +959,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
zend_execute_data *ptr = EX(prev_execute_data);
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_throw_error(NULL, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
EX(func)->common.scope ? "::" : "",
ZSTR_VAL(EX(func)->common.function_name),
@@ -886,7 +969,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
EX(func)->common.required_num_args == EX(func)->common.num_args ? "exactly" : "at least",
EX(func)->common.required_num_args);
} else {
zend_throw_error(NULL, "Too few arguments to function %s%s%s(), %d passed and %s %d expected",
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed and %s %d expected",
EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
EX(func)->common.scope ? "::" : "",
ZSTR_VAL(EX(func)->common.function_name),
@@ -896,41 +979,35 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
}
}
static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
static ZEND_COLD void zend_verify_return_error(
const zend_function *zf, const zend_class_entry *ce, zval *value)
{
const char *fname = ZSTR_VAL(zf->common.function_name);
const char *fsep;
const char *fclass;
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass;
const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
if (zf->common.scope) {
fsep = "::";
fclass = ZSTR_VAL(zf->common.scope->name);
} else {
fsep = "";
fclass = "";
}
zend_verify_type_error_common(
zf, arg_info, ce, value,
&fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
zend_type_error("Return value of %s%s%s() must %s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
zend_type_error("Return value of %s%s%s() must %s%s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
#if ZEND_DEBUG
static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
static ZEND_COLD void zend_verify_internal_return_error(
const zend_function *zf, const zend_class_entry *ce, zval *value)
{
const char *fname = ZSTR_VAL(zf->common.function_name);
const char *fsep;
const char *fclass;
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass;
const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
if (zf->common.scope) {
fsep = "::";
fclass = ZSTR_VAL(zf->common.scope->name);
} else {
fsep = "";
fclass = "";
}
zend_verify_type_error_common(
zf, arg_info, ce, value,
&fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must %s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must %s%s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind)
@@ -953,46 +1030,19 @@ static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, con
static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
{
zend_arg_info *ret_info = zf->common.arg_info - 1;
char *need_msg, *class_name;
zend_class_entry *ce;
zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1;
zend_class_entry *ce = NULL;
if (ret_info->type_hint) {
if (EXPECTED(ret_info->type_hint == Z_TYPE_P(ret))) {
if (ret_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info *)ret_info, &class_name, &ce);
if (!ce || !instanceof_function(Z_OBJCE_P(ret), ce)) {
zend_verify_internal_return_error(zf, need_msg, class_name, "instance of ", ZSTR_VAL(Z_OBJCE_P(ret)->name));
return 0;
}
}
} else if (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null) {
if (ret_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info *)ret_info, &class_name, &ce);
zend_verify_internal_return_error(zf, need_msg, class_name, zend_zval_type_name(ret), "");
} else if (ret_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(ret, IS_CALLABLE_CHECK_SILENT, NULL) && (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null)) {
zend_verify_internal_return_error(zf, "be callable", "", zend_zval_type_name(ret), "");
return 0;
}
} else if (ret_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(ret) && (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null)) {
zend_verify_internal_return_error(zf, "be iterable", "", zend_zval_type_name(ret), "");
return 0;
}
} else if (ret_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(ret) == IS_FALSE || Z_TYPE_P(ret) == IS_TRUE)) {
/* pass */
} else if (ret_info->type_hint == IS_VOID) {
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
} else {
/* Use strict check to verify return value of internal function */
zend_verify_internal_return_error(zf, "be of the type ", zend_get_type_by_const(ret_info->type_hint), zend_zval_type_name(ret), "");
return 0;
}
}
if (UNEXPECTED(ret_info->type_hint == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) {
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
return 0;
}
if (UNEXPECTED(!zend_check_internal_type(zf, ret_info, ret, &ce, 1))) {
zend_verify_internal_return_error(zf, ce, ret);
return 0;
}
return 1;
}
#endif
@@ -1000,99 +1050,30 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
static zend_always_inline void zend_verify_return_type(zend_function *zf, zval *ret, void **cache_slot)
{
zend_arg_info *ret_info = zf->common.arg_info - 1;
char *need_msg;
zend_class_entry *ce;
if (ret_info->type_hint) {
if (EXPECTED(ret_info->type_hint == Z_TYPE_P(ret))) {
if (ret_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(ret_info);
if (UNEXPECTED(!ce)) {
zend_verify_return_error(zf, "be an instance of ", ZSTR_VAL(ret_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(ret)->name));
return;
}
*cache_slot = (void*)ce;
}
if (UNEXPECTED(!instanceof_function(Z_OBJCE_P(ret), ce))) {
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_return_error(zf, need_msg, ZSTR_VAL(ce->name), "instance of ", ZSTR_VAL(Z_OBJCE_P(ret)->name));
}
}
} else if (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null) {
if (ret_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(ret_info);
if (UNEXPECTED(!ce)) {
zend_verify_return_error(zf, "be an instance of ", ZSTR_VAL(ret_info->class_name), zend_zval_type_name(ret), "");
return;
}
*cache_slot = (void*)ce;
}
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_return_error(zf, need_msg, ZSTR_VAL(ce->name), zend_zval_type_name(ret), "");
} else if (ret_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(ret, IS_CALLABLE_CHECK_SILENT, NULL)) {
zend_verify_return_error(zf, "be callable", "", zend_zval_type_name(ret), "");
}
} else if (ret_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(ret)) {
zend_verify_return_error(zf, "be iterable", "", zend_zval_type_name(ret), "");
}
} else if (ret_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(ret) == IS_FALSE || Z_TYPE_P(ret) == IS_TRUE)) {
/* pass */
/* There would be a check here for the IS_VOID type hint, which
* would trigger an error because a value had been returned.
* However, zend_compile.c already does a compile-time check
* that bans `return ...;` within a void function. Thus we can skip
* this part of the runtime check for non-internal functions.
*/
} else if (UNEXPECTED(!zend_verify_scalar_type_hint(ret_info->type_hint, ret, ZEND_RET_USES_STRICT_TYPES()))) {
zend_verify_return_error(zf, "be of the type ", zend_get_type_by_const(ret_info->type_hint), zend_zval_type_name(ret), "");
}
}
zend_class_entry *ce = NULL;
if (UNEXPECTED(!zend_check_type(zf, ret_info, ret, &ce, cache_slot, NULL, 1))) {
zend_verify_return_error(zf, ce, ret);
}
}
static ZEND_COLD int zend_verify_missing_return_type(zend_function *zf, void **cache_slot)
{
zend_arg_info *ret_info = zf->common.arg_info - 1;
char *need_msg;
zend_class_entry *ce;
if (ret_info->type_hint && EXPECTED(ret_info->type_hint != IS_VOID)) {
if (ret_info->type_hint && UNEXPECTED(ret_info->type_hint != IS_VOID)) {
zend_class_entry *ce = NULL;
if (ret_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
ce = (zend_class_entry*) *cache_slot;
} else {
ce = zend_verify_arg_class_kind(ret_info);
if (UNEXPECTED(!ce)) {
zend_verify_return_error(zf, "be an instance of ", ZSTR_VAL(ret_info->class_name), "none", "");
return 0;
if (ce) {
*cache_slot = (void*)ce;
}
*cache_slot = (void*)ce;
}
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_return_error(zf, need_msg, ZSTR_VAL(ce->name), "none", "");
return 0;
} else if (ret_info->type_hint == IS_CALLABLE) {
zend_verify_return_error(zf, "be callable", "", "none", "");
} else if (ret_info->type_hint == IS_ITERABLE) {
zend_verify_return_error(zf, "be iterable", "", "none", "");
} else {
zend_verify_return_error(zf, "be of the type ", zend_get_type_by_const(ret_info->type_hint), "none", "");
}
zend_verify_return_error(zf, ce, NULL);
return 0;
}
return 1;
@@ -1262,9 +1243,11 @@ static zend_never_inline ZEND_COLD void zend_wrong_string_offset(void)
case ZEND_ASSIGN_REF:
case ZEND_ADD_ARRAY_ELEMENT:
case ZEND_INIT_ARRAY:
case ZEND_MAKE_REF:
msg = "Cannot create references to/from string offsets";
break;
case ZEND_RETURN_BY_REF:
case ZEND_VERIFY_RETURN_TYPE:
msg = "Cannot return string offsets by reference";
break;
case ZEND_UNSET_DIM:
@@ -1351,6 +1334,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
zend_string_release(old_str);
} else {
SEPARATE_STRING(str);
zend_string_forget_hash_val(Z_STR_P(str));
}
Z_STRVAL_P(str)[offset] = c;
@@ -2378,9 +2362,12 @@ static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t o
if (UNEXPECTED(opline->opcode == ZEND_INIT_FCALL ||
opline->opcode == ZEND_INIT_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_NS_FCALL_BY_NAME ||
opline->opcode == ZEND_INIT_DYNAMIC_CALL ||
opline->opcode == ZEND_INIT_USER_CALL ||
opline->opcode == ZEND_INIT_METHOD_CALL ||
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL)) {
opline->opcode == ZEND_INIT_STATIC_METHOD_CALL ||
opline->opcode == ZEND_NEW)) {
ZEND_ASSERT(op_num);
opline--;
}
+30 -41
View File
@@ -597,26 +597,24 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
RESET_CONSTANT_VISITED(p);
return FAILURE;
} else {
zend_string *save = Z_STR_P(p);
char *slash;
size_t actual_len = Z_STRLEN_P(p);
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
if (inline_change) {
zend_string *s = zend_string_init(actual, actual_len, 0);
Z_STR_P(p) = s;
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
}
}
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save));
if (inline_change) {
zend_string_release(save);
}
zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(p));
RESET_CONSTANT_VISITED(p);
return FAILURE;
} else {
zend_string *save = Z_STR_P(p);
size_t actual_len = Z_STRLEN_P(p);
char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
if (slash) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
if (inline_change) {
zend_string *s = zend_string_init(actual, actual_len, 0);
Z_STR_P(p) = s;
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
}
}
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
if (!inline_change) {
ZVAL_STRINGL(p, actual, actual_len);
@@ -790,41 +788,29 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
if (ARG_SHOULD_BE_SENT_BY_REF(func, i + 1)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (fci->no_separation &&
!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
if (i) {
/* hack to clean up the stack */
ZEND_CALL_NUM_ARGS(call) = i;
zend_vm_stack_free_args(call);
}
zend_vm_stack_free_call_frame(call);
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
i+1,
if (!fci->no_separation) {
/* Separation is enabled -- create a ref */
ZVAL_NEW_REF(arg, arg);
} else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
/* By-value send is not allowed -- emit a warning,
* but still perform the call with a by-value send. */
zend_error(E_WARNING,
"Parameter %d to %s%s%s() expected to be a reference, value given", i+1,
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
func->common.scope ? "::" : "",
ZSTR_VAL(func->common.function_name));
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
ZVAL_NEW_REF(arg, arg);
}
Z_ADDREF_P(arg);
} else {
if (Z_ISREF_P(arg) &&
!(func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
/* don't separate references for __call */
arg = Z_REFVAL_P(arg);
}
if (Z_OPT_REFCOUNTED_P(arg)) {
Z_ADDREF_P(arg);
}
}
param = ZEND_CALL_ARG(call, i+1);
ZVAL_COPY_VALUE(param, arg);
ZVAL_COPY(param, arg);
}
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
@@ -1188,7 +1174,8 @@ static void zend_timeout_handler(int dummy) /* {{{ */
/* Die on hard timeout */
const char *error_filename = NULL;
uint error_lineno = 0;
char *log_buffer = NULL;
char log_buffer[2048];
int output_len = 0;
if (zend_is_compiling()) {
error_filename = ZSTR_VAL(zend_get_compiled_filename());
@@ -1206,8 +1193,10 @@ static void zend_timeout_handler(int dummy) /* {{{ */
error_filename = "Unknown";
}
zend_spprintf(&log_buffer, 0, "\nFatal error: Maximum execution time of " ZEND_LONG_FMT "+" ZEND_LONG_FMT " seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
write(2, log_buffer, strlen(log_buffer));
output_len = snprintf(log_buffer, sizeof(log_buffer), "\nFatal error: Maximum execution time of " ZEND_LONG_FMT "+" ZEND_LONG_FMT " seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
if (output_len > 0) {
write(2, log_buffer, MIN(output_len, sizeof(log_buffer)));
}
_exit(1);
}
#endif
+53 -3
View File
@@ -19,6 +19,56 @@
/* $Id$ */
/**
* zend_gc_collect_cycles
* ======================
*
* Colors and its meaning
* ----------------------
*
* BLACK (GC_BLACK) - In use or free.
* GREY (GC_GREY) - Possible member of cycle.
* WHITE (GC_WHITE) - Member of garbage cycle.
* PURPLE (GC_PURPLE) - Possible root of cycle.
*
* Colors described in the paper but not used
* ------------------------------------------
*
* GREEN - Acyclic
* RED - Candidate cycle underogin
* ORANGE - Candidate cycle awaiting epoch boundary.
*
*
* Flow
* =====
*
* The garbage collect cycle starts from 'gc_mark_roots', which traverses the
* possible roots, and calls mark_grey for roots are marked purple with
* depth-first traverse.
*
* After all possible roots are traversed and marked,
* gc_scan_roots will be called, and each root will be called with
* gc_scan(root->ref)
*
* gc_scan checkes the colors of possible members.
*
* If the node is marked as grey and the refcount > 0
* gc_scan_black will be called on that node to scan it's subgraph.
* otherwise (refcount == 0), it marks the node white.
*
* A node MAY be added to possbile roots when ZEND_UNSET_VAR happens or
* zend_assign_to_variable is called only when possible garbage node is
* produced.
* gc_possible_root() will be called to add the nodes to possible roots.
*
*
* For objects, we call their get_gc handler (by default 'zend_std_get_gc') to
* get the object properties to scan.
*
*
* @see http://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon01Concurrent.pdf
*/
#include "zend.h"
#include "zend_API.h"
@@ -685,7 +735,6 @@ static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **addition
GC_TYPE(ref) |= GC_FAKE_BUFFER_FLAG;
}
if (buf) {
GC_REFCOUNT(ref)++;
buf->ref = ref;
buf->next = GC_G(roots).next;
buf->prev = &GC_G(roots);
@@ -848,7 +897,6 @@ static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_b
current = GC_G(roots).next;
while (current != &GC_G(roots)) {
GC_REFCOUNT(current->ref)++;
if (GC_REF_GET_COLOR(current->ref) == GC_WHITE) {
count += gc_collect_white(current->ref, flags, additional_buffer);
}
@@ -889,7 +937,6 @@ tail_call:
GC_REF_GET_COLOR(ref) == GC_BLACK &&
GC_ADDRESS(GC_INFO(ref)) != GC_ROOT_BUFFER_MAX_ENTRIES)) {
GC_TRACE_REF(ref, "removing from buffer");
GC_REFCOUNT(ref)--;
if (root) {
GC_INFO(ref) = 0;
GC_REMOVE_FROM_ROOTS(root);
@@ -1097,6 +1144,7 @@ ZEND_API int zend_gc_collect_cycles(void)
if (EG(objects_store).object_buckets &&
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
GC_TYPE(obj) = IS_NULL;
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
@@ -1156,4 +1204,6 @@ ZEND_API int zend_gc_collect_cycles(void)
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*
* vim:noexpandtab:
*/
+10
View File
@@ -635,6 +635,16 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
EG(current_execute_data) = original_execute_data;
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
leaf->node.ptr.root = root;
root->node.parent = NULL;
if (old_root) {
OBJ_RELEASE(&old_root->std);
}
zend_generator_resume(leaf);
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
}
} else {
zval_ptr_dtor(&root->value);
ZVAL_COPY(&root->value, &root->node.parent->value);
+2 -1
View File
@@ -292,7 +292,8 @@ struct _zend_php_scanner_globals {
int scanned_string_len;
/* hooks */
void (* on_event)(zend_php_scanner_event event, int token, int line);
void (*on_event)(zend_php_scanner_event event, int token, int line, void *context);
void *on_event_context;
};
#endif /* ZEND_GLOBALS_H */
-1
View File
@@ -2444,7 +2444,6 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
register const char *tmp = key;
const char *end = key + length;
ZEND_ASSERT(*end == '\0');
if (*tmp == '-') {
tmp++;
+1 -1
View File
@@ -260,7 +260,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
%}
%expect 0
%pure_parser
%pure-parser
%token TC_SECTION
%token TC_RAW
+11 -9
View File
@@ -43,7 +43,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%}
%pure_parser
%pure-parser
%expect 0
%code requires {
@@ -544,8 +544,8 @@ implements_list:
foreach_variable:
variable { $$ = $1; }
| '&' variable { $$ = zend_ast_create(ZEND_AST_REF, $2); }
| T_LIST '(' array_pair_list ')' { $3->attr = 1; $$ = $3; }
| '[' array_pair_list ']' { $$ = $2; }
| T_LIST '(' array_pair_list ')' { $$ = $3; $$->attr = ZEND_ARRAY_SYNTAX_LIST; }
| '[' array_pair_list ']' { $$ = $2; $$->attr = ZEND_ARRAY_SYNTAX_SHORT; }
;
for_statement:
@@ -866,9 +866,9 @@ new_expr:
expr_without_variable:
T_LIST '(' array_pair_list ')' '=' expr
{ $3->attr = 1; $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
{ $3->attr = ZEND_ARRAY_SYNTAX_LIST; $$ = zend_ast_create(ZEND_AST_ASSIGN, $3, $6); }
| '[' array_pair_list ']' '=' expr
{ $$ = zend_ast_create(ZEND_AST_ASSIGN, $2, $5); }
{ $2->attr = ZEND_ARRAY_SYNTAX_SHORT; $$ = zend_ast_create(ZEND_AST_ASSIGN, $2, $5); }
| variable '=' expr
{ $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
| variable '=' '&' variable
@@ -1060,8 +1060,8 @@ ctor_arguments:
dereferencable_scalar:
T_ARRAY '(' array_pair_list ')' { $$ = $3; }
| '[' array_pair_list ']' { $$ = $2; }
T_ARRAY '(' array_pair_list ')' { $$ = $3; $$->attr = ZEND_ARRAY_SYNTAX_LONG; }
| '[' array_pair_list ']' { $$ = $2; $$->attr = ZEND_ARRAY_SYNTAX_SHORT; }
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
;
@@ -1209,9 +1209,11 @@ array_pair:
| '&' variable
{ $$ = zend_ast_create_ex(ZEND_AST_ARRAY_ELEM, 1, $2, NULL); }
| expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')'
{ $5->attr = 1; $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $5, $1); }
{ $5->attr = ZEND_ARRAY_SYNTAX_LIST;
$$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $5, $1); }
| T_LIST '(' array_pair_list ')'
{ $3->attr = 1; $$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, NULL); }
{ $3->attr = ZEND_ARRAY_SYNTAX_LIST;
$$ = zend_ast_create(ZEND_AST_ARRAY_ELEM, $3, NULL); }
;
encaps_list:
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -51,7 +51,8 @@ typedef struct _zend_lex_state {
const zend_encoding *script_encoding;
/* hooks */
void (* on_event)(zend_php_scanner_event event, int token, int line);
void (*on_event)(zend_php_scanner_event event, int token, int line, void *context);
void *on_event_context;
zend_ast *ast;
zend_arena *ast_arena;
+8 -2
View File
@@ -226,6 +226,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state)
lex_state->script_encoding = SCNG(script_encoding);
lex_state->on_event = SCNG(on_event);
lex_state->on_event_context = SCNG(on_event_context);
lex_state->ast = CG(ast);
lex_state->ast_arena = CG(ast_arena);
@@ -265,6 +266,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
SCNG(script_encoding) = lex_state->script_encoding;
SCNG(on_event) = lex_state->on_event;
SCNG(on_event_context) = lex_state->on_event_context;
CG(ast) = lex_state->ast;
CG(ast_arena) = lex_state->ast_arena;
@@ -284,7 +286,9 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
ZEND_API void zend_lex_tstring(zval *zv)
{
if (SCNG(on_event)) SCNG(on_event)(ON_FEEDBACK, T_STRING, 0);
if (SCNG(on_event)) {
SCNG(on_event)(ON_FEEDBACK, T_STRING, 0, SCNG(on_event_context));
}
ZVAL_STRINGL(zv, (char*)SCNG(yy_text), SCNG(yy_leng));
}
@@ -1082,7 +1086,9 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
static zend_always_inline int emit_token(int token, int token_line)
{
if(SCNG(on_event)) SCNG(on_event)(ON_TOKEN, token, token_line);
if (SCNG(on_event)) {
SCNG(on_event)(ON_TOKEN, token, token_line, SCNG(on_event_context));
}
return token;
}
-10
View File
@@ -200,12 +200,8 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
it should return whether the call was successful or not
*/
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member);
zval_ptr_dtor(member);
EG(fake_scope) = orig_fake_scope;
}
/* }}} */
@@ -219,9 +215,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
EG(fake_scope) = NULL;
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
/* __set handler is called with two arguments:
property name
value to be set
@@ -230,9 +223,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
*/
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value);
zval_ptr_dtor(member);
zval_ptr_dtor(value);
if (Z_TYPE(retval) != IS_UNDEF) {
result = i_zend_is_true(&retval) ? SUCCESS : FAILURE;
zval_ptr_dtor(&retval);
-2
View File
@@ -90,7 +90,6 @@ void zend_signal_activate(void);
void zend_signal_deactivate(void);
void zend_signal_startup(void);
void zend_signal_init(void);
void zend_signal_shutdown(void);
ZEND_API int zend_signal(int signo, void (*handler)(int));
ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact);
@@ -104,7 +103,6 @@ ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigac
# define zend_signal_deactivate()
# define zend_signal_startup()
# define zend_signal_init()
# define zend_signal_shutdown()
# define zend_signal(signo, handler) signal(signo, handler)
# define zend_sigaction(signo, act, oldact) sigaction(signo, act, oldact)
+17
View File
@@ -917,6 +917,23 @@ static zend_always_inline uint32_t zval_delref_p(zval* pz) {
efree_size(ref, sizeof(zend_reference)); \
} while (0)
#define ZVAL_COPY_UNREF(z, v) do { \
zval *_z3 = (v); \
if (Z_REFCOUNTED_P(_z3)) { \
if (UNEXPECTED(Z_ISREF_P(_z3)) \
&& UNEXPECTED(Z_REFCOUNT_P(_z3) == 1)) { \
ZVAL_UNREF(_z3); \
if (Z_REFCOUNTED_P(_z3)) { \
Z_ADDREF_P(_z3); \
} \
} else { \
Z_ADDREF_P(_z3); \
} \
} \
ZVAL_COPY_VALUE(z, _z3); \
} while (0)
#define SEPARATE_STRING(zv) do { \
zval *_zv = (zv); \
if (Z_REFCOUNTED_P(_zv) && \
+4 -3
View File
@@ -299,8 +299,8 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
WIN32_FILE_ATTRIBUTE_DATA data;
LARGE_INTEGER t;
const size_t path_len = strlen(path);
ALLOCA_FLAG(use_heap_large);
wchar_t *pathw = php_win32_ioutil_any_to_w(path);
ALLOCA_FLAG(use_heap_large)
if (!pathw) {
return -1;
@@ -311,7 +311,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
#if ZEND_ENABLE_ZVAL_LONG64
ret = _wstat64(pathw, buf);
#else
ret = _wstat(pathw, buf);
ret = _wstat(pathw, (struct _stat32 *)buf);
#endif
free(pathw);
@@ -1251,7 +1251,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int add_slash;
void *tmp;
if (path_length == 0 || path_length >= MAXPATHLEN-1) {
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
#ifdef ZEND_WIN32
_set_errno(EINVAL);
#else
@@ -1406,6 +1406,7 @@ verify:
tmp = erealloc(state->cwd, state->cwd_length+1);
if (tmp == NULL) {
CWD_STATE_FREE(&old_state);
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "Out of memory\n");
#endif
+67 -58
View File
@@ -1557,10 +1557,7 @@ ZEND_VM_C_LABEL(fetch_this):
ZEND_ASSERT(retval != NULL);
if (type == BP_VAR_R || type == BP_VAR_IS) {
if (/*type == BP_VAR_R &&*/ Z_ISREF_P(retval) && Z_REFCOUNT_P(retval) == 1) {
ZVAL_UNREF(retval);
}
ZVAL_COPY(EX_VAR(opline->result.var), retval);
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
} else {
ZVAL_INDIRECT(EX_VAR(opline->result.var), retval);
}
@@ -1698,10 +1695,7 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
ZEND_VM_C_LABEL(fetch_static_prop_return):
ZEND_ASSERT(retval != NULL);
if (type == BP_VAR_R || type == BP_VAR_IS) {
if (/*type == BP_VAR_R &&*/ Z_ISREF_P(retval) && Z_REFCOUNT_P(retval) == 1) {
ZVAL_UNREF(retval);
}
ZVAL_COPY(EX_VAR(opline->result.var), retval);
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
} else {
ZVAL_INDIRECT(EX_VAR(opline->result.var), retval);
}
@@ -1758,7 +1752,7 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
ZEND_VM_C_LABEL(fetch_dim_r_array):
value = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, OP2_TYPE, BP_VAR_R);
result = EX_VAR(opline->result.var);
ZVAL_COPY(result, value);
ZVAL_COPY_UNREF(result, value);
} else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
container = Z_REFVAL_P(container);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -1928,13 +1922,13 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR
if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
break;
}
} else if (EXPECTED(zobj->properties != NULL)) {
retval = zend_hash_find(zobj->properties, Z_STR_P(offset));
if (EXPECTED(retval)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
break;
}
}
@@ -1948,7 +1942,7 @@ ZEND_VM_C_LABEL(fetch_obj_r_no_object):
retval = zobj->handlers->read_property(container, offset, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(offset)) : NULL), EX_VAR(opline->result.var));
if (retval != EX_VAR(opline->result.var)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
}
}
} while (0);
@@ -2451,6 +2445,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV, SRC)
UNEXPECTED(!Z_ISERROR_P(EX_VAR(opline->op1.var)))) {
zend_throw_error(NULL, "Cannot assign by reference to overloaded object");
FREE_OP1_VAR_PTR();
FREE_OP2_VAR_PTR();
HANDLE_EXCEPTION();
@@ -2506,9 +2501,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
#endif
GC_REFCOUNT(object)--;
if (GC_REFCOUNT(object) == 1) {
zend_object_store_ctor_failed(object);
}
zend_object_store_ctor_failed(object);
}
OBJ_RELEASE(object);
} else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
@@ -2543,9 +2536,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
#endif
GC_REFCOUNT(object)--;
if (GC_REFCOUNT(object) == 1) {
zend_object_store_ctor_failed(object);
}
zend_object_store_ctor_failed(object);
}
OBJ_RELEASE(object);
} else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
@@ -3809,9 +3800,7 @@ ZEND_VM_C_LABEL(fcall_end):
if (UNEXPECTED(EG(exception) != NULL) && (ZEND_CALL_INFO(call) & ZEND_CALL_CTOR)) {
#endif
GC_REFCOUNT(object)--;
if (GC_REFCOUNT(object) == 1) {
zend_object_store_ctor_failed(object);
}
zend_object_store_ctor_failed(object);
}
OBJ_RELEASE(object);
}
@@ -4168,6 +4157,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV, JMP_ADDR)
USE_OPLINE
zend_class_entry *ce, *catch_ce;
zend_object *exception;
zval *ex;
SAVE_OPLINE();
/* Check whether an exception has been thrown, if not, jump over code */
@@ -4202,8 +4192,12 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV, JMP_ADDR)
}
exception = EG(exception);
zval_ptr_dtor(EX_VAR(opline->op2.var));
ZVAL_OBJ(EX_VAR(opline->op2.var), EG(exception));
ex = EX_VAR(opline->op2.var);
if (UNEXPECTED(Z_ISREF_P(ex))) {
ex = Z_REFVAL_P(ex);
}
zval_ptr_dtor(ex);
ZVAL_OBJ(ex, EG(exception));
if (UNEXPECTED(EG(exception) != exception)) {
GC_REFCOUNT(EG(exception))++;
HANDLE_EXCEPTION();
@@ -4632,23 +4626,15 @@ ZEND_VM_C_LABEL(send_array):
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
/* By-value send is not allowed -- emit a warning,
* but still perform the call. */
zend_error(E_WARNING,
"Parameter %d to %s%s%s() expected to be a reference, value given",
arg_num,
EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
EX(call)->func->common.scope ? "::" : "",
ZSTR_VAL(EX(call)->func->common.function_name));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
}
if (Z_TYPE(EX(call)->This) == IS_OBJECT) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
EX(call)->func = (zend_function*)&zend_pass_function;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
break;
}
}
} else {
@@ -4679,25 +4665,12 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, NUM)
param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) {
ZVAL_DEREF(arg);
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
opline->op2.num,
EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
EX(call)->func->common.scope ? "::" : "",
ZSTR_VAL(EX(call)->func->common.function_name));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
}
if (Z_TYPE(EX(call)->This) == IS_OBJECT) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
ZVAL_UNDEF(param);
EX(call)->func = (zend_function*)&zend_pass_function;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
FREE_OP1();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
if (Z_ISREF_P(arg) &&
!(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
@@ -4747,6 +4720,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, NUM, CONST)
if (Z_OPT_CONSTANT_P(param)) {
SAVE_OPLINE();
if (UNEXPECTED(zval_update_constant_ex(param, EX(func)->op_array.scope) != SUCCESS)) {
zval_ptr_dtor(param);
ZVAL_UNDEF(param);
HANDLE_EXCEPTION();
}
@@ -4886,14 +4860,6 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
SAVE_OPLINE();
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
} else if ((OP1_TYPE & IS_VAR) && UNEXPECTED(Z_ISREF_P(op1))) {
/* Don't keep lock on reference, lock the value instead */
if (UNEXPECTED(Z_REFCOUNT_P(op1) == 1)) {
ZVAL_UNREF(op1);
} else {
Z_DELREF_P(op1);
ZVAL_COPY(op1, Z_REFVAL_P(op1));
}
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF)) {
op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
@@ -4940,6 +4906,11 @@ ZEND_VM_HANDLER(68, ZEND_NEW, UNUSED|CLASS_FETCH|CONST|VAR, ANY, NUM)
constructor = Z_OBJ_HT_P(result)->get_constructor(Z_OBJ_P(result));
if (constructor == NULL) {
if (UNEXPECTED(EG(exception))) {
zval_ptr_dtor(result);
HANDLE_EXCEPTION();
}
/* If there are no arguments, skip over the DO_FCALL opcode. We check if the next
* opcode is DO_FCALL in case EXT instructions are used. */
if (EXPECTED(opline->extended_value == 0 && (opline+1)->opcode == ZEND_DO_FCALL)) {
@@ -5403,6 +5374,10 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMPVAR|CV, ANY, EVAL)
new_op_array = zend_include_or_eval(inc_filename, opline->extended_value);
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
if (new_op_array != ZEND_FAKE_OP_ARRAY && new_op_array != NULL) {
destroy_op_array(new_op_array);
efree_size(new_op_array, sizeof(zend_op_array));
}
HANDLE_EXCEPTION();
} else if (new_op_array == ZEND_FAKE_OP_ARRAY) {
if (RETURN_VALUE_USED(opline)) {
@@ -5763,6 +5738,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR)
if (UNEXPECTED(!iter) || UNEXPECTED(EG(exception))) {
FREE_OP1();
if (iter) {
OBJ_RELEASE(&iter->std);
}
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0, "Object of type %s did not create an Iterator", ZSTR_VAL(ce->name));
}
@@ -7273,6 +7251,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
ZVAL_COPY(&c.value, val);
if (Z_OPT_CONSTANT(c.value)) {
if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) {
zval_ptr_dtor(&c.value);
FREE_OP1();
FREE_OP2();
HANDLE_EXCEPTION();
@@ -7510,12 +7489,14 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
if (Z_ISUNDEF(new_gen->retval)) {
if (UNEXPECTED(zend_generator_get_current(new_gen) == generator)) {
zend_throw_error(NULL, "Impossible to yield from the Generator being currently run");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
zend_generator_yield_from(generator, new_gen);
}
} else if (UNEXPECTED(new_gen->execute_data == NULL)) {
zend_throw_error(NULL, "Generator passed to yield from was aborted without proper return and is unable to continue");
zval_ptr_dtor(val);
HANDLE_EXCEPTION();
} else {
if (RETURN_VALUE_USED(opline)) {
@@ -8116,6 +8097,34 @@ ZEND_VM_HANDLER(49, ZEND_CHECK_VAR, CV, UNUSED)
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(51, ZEND_MAKE_REF, VAR|CV, UNUSED)
{
USE_OPLINE
zval *op1 = EX_VAR(opline->op1.var);
if (OP1_TYPE == IS_CV) {
if (UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
ZVAL_NEW_EMPTY_REF(op1);
Z_SET_REFCOUNT_P(op1, 2);
ZVAL_NULL(Z_REFVAL_P(op1));
ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1));
} else {
ZVAL_MAKE_REF(op1);
ZVAL_COPY(EX_VAR(opline->result.var), op1);
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_INDIRECT)) {
op1 = Z_INDIRECT_P(op1);
if (EXPECTED(!Z_ISREF_P(op1))) {
ZVAL_MAKE_REF(op1);
}
GC_REFCOUNT(Z_REF_P(op1))++;
ZVAL_REF(EX_VAR(opline->result.var), Z_REF_P(op1));
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), op1);
}
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_TYPE_SPEC_HANDLER(ZEND_ADD, (res_info == MAY_BE_LONG && op1_info == MAY_BE_LONG && op2_info == MAY_BE_LONG), ZEND_ADD_LONG_NO_OVERFLOW, CONST|TMPVARCV, CONST|TMPVARCV, SPEC(NO_CONST_CONST,COMMUTATIVE))
{
USE_OPLINE
@@ -8537,7 +8546,7 @@ ZEND_VM_C_LABEL(fetch_dim_r_index_array):
offset = zval_get_long(dim);
}
ZEND_HASH_INDEX_FIND(Z_ARRVAL_P(container), offset, value, ZEND_VM_C_LABEL(fetch_dim_r_index_undef));
ZVAL_COPY(EX_VAR(opline->result.var), value);
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), value);
if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) {
SAVE_OPLINE();
FREE_OP1();
+355 -365
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1827,7 +1827,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
gen_specs($f, $spec, $kind, $prolog."\t", $specs);
out($f,$prolog."};\n");
out($f,$prolog."zend_opcode_handlers = labels;\n");
out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
out($f,$prolog."zend_spec_handlers = specs;\n");
}
break;
+2 -2
View File
@@ -73,7 +73,7 @@ static const char *zend_vm_opcodes_names[187] = {
"ZEND_CASE",
"ZEND_CHECK_VAR",
"ZEND_SEND_VAR_NO_REF_EX",
NULL,
"ZEND_MAKE_REF",
"ZEND_BOOL",
"ZEND_FAST_CONCAT",
"ZEND_ROPE_INIT",
@@ -263,7 +263,7 @@ static uint32_t zend_vm_opcodes_flags[187] = {
0x00000707,
0x00000101,
0x00001001,
0x00000000,
0x00000101,
0x00000007,
0x00000707,
0x01000701,
+1
View File
@@ -118,6 +118,7 @@ END_EXTERN_C()
#define ZEND_CASE 48
#define ZEND_CHECK_VAR 49
#define ZEND_SEND_VAR_NO_REF_EX 50
#define ZEND_MAKE_REF 51
#define ZEND_BOOL 52
#define ZEND_FAST_CONCAT 53
#define ZEND_ROPE_INIT 54
+5 -5
View File
@@ -2334,13 +2334,13 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
dnl If pkg-config is found try using it
if test "$PHP_OPENSSL_DIR" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
if $PKG_CONFIG --atleast-version=0.9.8 openssl; then
if $PKG_CONFIG --atleast-version=1.0.1 openssl; then
found_openssl=yes
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
else
AC_MSG_ERROR([OpenSSL version 0.9.8 or greater required.])
AC_MSG_ERROR([OpenSSL version 1.0.1 or greater required.])
fi
if test -n "$OPENSSL_LIBS"; then
@@ -2381,13 +2381,13 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
AC_MSG_CHECKING([for OpenSSL version])
AC_EGREP_CPP(yes,[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
#if OPENSSL_VERSION_NUMBER >= 0x10001001L
yes
#endif
],[
AC_MSG_RESULT([>= 0.9.8])
AC_MSG_RESULT([>= 1.0.1])
],[
AC_MSG_ERROR([OpenSSL version 0.9.8 or greater required.])
AC_MSG_ERROR([OpenSSL version 1.0.1 or greater required.])
])
CPPFLAGS=$old_CPPFLAGS
+2 -2
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="alpha3"
PHP_EXTRA_VERSION="RC1"
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`
@@ -799,7 +799,7 @@ if test "$PHP_GCOV" = "yes"; then
dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
ltp_version_min="105"
dnl non-working versions, e.g. "1.8 1.18";
dnl remove "none" when introducing the first incompatible LTP version an
dnl remove "none" when introducing the first incompatible LTP version and
dnl separate any following additions by spaces
ltp_version_exclude="1.8"
+1 -1
View File
@@ -92,7 +92,7 @@ typedef struct bc_struct
/* Define the _PROTOTYPE macro if it is needed. */
#ifndef _PROTOTYPE
#ifdef __STDC__
#if defined(__STDC__) || defined(PHP_WIN32) && defined(__clang__)
#define _PROTOTYPE(func, args) func args
#else
#define _PROTOTYPE(func, args) func()
+31 -10
View File
@@ -148,7 +148,11 @@ static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count)
just_read = BZ2_bzread(self->bz_file, buf, to_read);
if (just_read < 1) {
stream->eof = 0 == just_read;
/* it is not safe to keep reading after an error, see #72613 */
stream->eof = 1;
if (just_read < 0) {
return -1;
}
break;
}
@@ -558,7 +562,8 @@ static PHP_FUNCTION(bzcompress)
Decompresses BZip2 compressed data */
static PHP_FUNCTION(bzdecompress)
{
char *source, *dest;
char *source;
zend_string *dest;
size_t source_len;
int error;
zend_long small = 0;
@@ -585,24 +590,40 @@ static PHP_FUNCTION(bzdecompress)
/* in most cases bz2 offers at least 2:1 compression, so we use that as our base */
bzs.avail_out = source_len * 2;
bzs.next_out = dest = emalloc(bzs.avail_out + 1);
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) {
/* compression is better then 2:1, need to allocate more memory */
bzs.avail_out = source_len;
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = safe_erealloc(dest, 1, bzs.avail_out+1, (size_t) size );
bzs.next_out = dest + size;
#if !ZEND_ENABLE_ZVAL_LONG64
if (size > SIZE_MAX) {
/* no reason to continue if we're going to drop it anyway */
break;
}
#endif
dest = zend_string_safe_realloc(dest, 1, bzs.avail_out+1, (size_t) size, 0);
bzs.next_out = ZSTR_VAL(dest) + size;
}
if (error == BZ_STREAM_END || error == BZ_OK) {
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = safe_erealloc(dest, 1, (size_t) size, 1);
dest[size] = '\0';
RETVAL_STRINGL(dest, (int) size);
efree(dest);
#if !ZEND_ENABLE_ZVAL_LONG64
if (UNEXPECTED(size > SIZE_MAX)) {
php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX);
zend_string_free(dest);
RETVAL_LONG(BZ_MEM_ERROR);
} else
#endif
{
dest = zend_string_safe_realloc(dest, 1, (size_t)size, 1, 0);
ZSTR_LEN(dest) = (size_t)size;
ZSTR_VAL(dest)[(size_t)size] = '\0';
RETVAL_STR(dest);
}
} else { /* real error */
efree(dest);
zend_string_free(dest);
RETVAL_LONG(error);
}
Binary file not shown.
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #72613 (Inadequate error handling in bzread())
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
$fp = bzopen(__DIR__.'/72613.bz2', 'r');
if ($fp === FALSE) {
exit("ERROR: bzopen()");
}
$data = "";
while (!feof($fp)) {
$res = bzread($fp);
if ($res === FALSE) {
exit("ERROR: bzread()");
}
$data .= $res;
}
bzclose($fp);
?>
DONE
--EXPECT--
DONE
+23 -11
View File
@@ -24,10 +24,6 @@
#include "config.h"
#endif
#ifdef PHP_WIN32
#define _WINNLS_
#endif
#include "php.h"
#include "ext/standard/info.h"
#include "php_calendar.h"
@@ -35,6 +31,12 @@
#include <stdio.h>
#ifdef PHP_WIN32
/* This conflicts with a define in winnls.h, but that header is needed
to have GetACP(). */
#undef CAL_GREGORIAN
#endif
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_unixtojd, 0, 0, 0)
ZEND_ARG_INFO(0, timestamp)
@@ -357,6 +359,10 @@ PHP_FUNCTION(cal_days_in_month)
}
else {
sdn_next = calendar->to_jd(year + 1, 1, 1);
if (cal == CAL_FRENCH && sdn_next == 0) {
/* The French calendar ends on 0014-13-05. */
sdn_next = 2380953;
}
}
}
@@ -414,15 +420,21 @@ PHP_FUNCTION(cal_from_jd)
add_assoc_long(return_value, "year", year);
/* day of week */
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
if (cal != CAL_JEWISH || year > 0) {
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
} else {
add_assoc_null(return_value, "dow");
add_assoc_string(return_value, "abbrevdayname", "");
add_assoc_string(return_value, "dayname", "");
}
/* month name */
if(cal == CAL_JEWISH) {
/* special case for Jewish calendar */
add_assoc_string(return_value, "abbrevmonth", JEWISH_MONTH_NAME(year)[month]);
add_assoc_string(return_value, "monthname", JEWISH_MONTH_NAME(year)[month]);
add_assoc_string(return_value, "abbrevmonth", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
add_assoc_string(return_value, "monthname", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
} else {
add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month]);
add_assoc_string(return_value, "monthname", calendar->month_name_long[month]);
@@ -735,7 +747,7 @@ PHP_FUNCTION(jdmonthname)
break;
case CAL_MONTH_JEWISH: /* jewish month */
SdnToJewish(julday, &year, &month, &day);
monthname = JEWISH_MONTH_NAME(year)[month];
monthname = (year > 0 ? JEWISH_MONTH_NAME(year)[month] : "");
break;
case CAL_MONTH_FRENCH: /* french month */
SdnToFrench(julday, &year, &month, &day);
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #67976 (cal_days_month() fails for final month of the French calendar)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
var_dump(cal_days_in_month(CAL_FRENCH, 13, 14));
?>
--EXPECT--
int(5)
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Bug #71894 (AddressSanitizer: global-buffer-overflow in zif_cal_from_jd)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
var_dump(cal_from_jd(347997, CAL_JEWISH));
var_dump(jdmonthname(347997,CAL_MONTH_JEWISH));?>
--EXPECT--
array(9) {
["date"]=>
string(5) "0/0/0"
["month"]=>
int(0)
["day"]=>
int(0)
["year"]=>
int(0)
["dow"]=>
NULL
["abbrevdayname"]=>
string(0) ""
["dayname"]=>
string(0) ""
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
string(0) ""
}
string(0) ""
@@ -0,0 +1,28 @@
--TEST--
jdtogregorian(): test overflow
--CREDITS--
neweracracker@gmail.com
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only');
?>
--FILE--
<?php
for ($i=536838860; $i<536838870; $i++) {
echo $i, ':', jdtogregorian($i), PHP_EOL;
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
536838860:10/11/1465102
536838861:10/12/1465102
536838862:10/13/1465102
536838863:10/14/1465102
536838864:10/15/1465102
536838865:10/16/1465102
536838866:10/17/1465102
536838867:0/0/0
536838868:0/0/0
536838869:0/0/0
DONE
@@ -0,0 +1,27 @@
--TEST--
jdtojewish(): test overflow
--CREDITS--
neweracracker@gmail.com
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
for ($i=324542840; $i<324542850; $i++) {
echo $i, ':', jdtojewish($i), PHP_EOL;
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
324542840:12/7/887605
324542841:12/8/887605
324542842:12/9/887605
324542843:12/10/887605
324542844:12/11/887605
324542845:12/12/887605
324542846:12/13/887605
324542847:0/0/0
324542848:0/0/0
324542849:0/0/0
DONE
+6 -5
View File
@@ -553,7 +553,10 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
for (i = 0, j = 0; i < nargs; i++) {
/* if this was byref, update the zval */
if (f->arg_info[nargs - i - 1].pass_by_reference) {
SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]);
zval *arg = &args[nargs - i - 1];
ZVAL_DEREF(arg);
SEPARATE_ZVAL_NOREF(arg);
/* if the variant is pointing at the byref_vals, we need to map
* the pointee value as a zval; otherwise, the value is pointing
@@ -561,14 +564,12 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
if (V_VT(&vargs[i]) & VT_BYREF) {
if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
/* copy that value */
php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
obj->code_page);
php_com_zval_from_variant(arg, &byref_vals[j], obj->code_page);
}
} else {
/* not sure if this can ever happen; the variant we marked as BYREF
* is no longer BYREF - copy its value */
php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
obj->code_page);
php_com_zval_from_variant(arg, &vargs[i], obj->code_page);
}
VariantClear(&byref_vals[j]);
j++;
+2 -2
View File
@@ -279,7 +279,6 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
f.function_name = zend_string_copy(name);
f.handler = PHP_FN(com_method_handler);
zend_set_function_arg_flags((zend_function*)&f);
fptr = &f;
@@ -305,11 +304,12 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) {
f.arg_info[i].allow_null = 1;
if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) {
f.arg_info[i].pass_by_reference = 1;
f.arg_info[i].pass_by_reference = ZEND_SEND_BY_REF;
}
}
f.num_args = bindptr.lpfuncdesc->cParams;
zend_set_function_arg_flags((zend_function*)&f);
ITypeInfo_ReleaseFuncDesc(TI, bindptr.lpfuncdesc);
break;
+6 -1
View File
@@ -100,7 +100,12 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z));
zend_uchar ztype = IS_NULL;
if (z) {
ZVAL_DEREF(z);
ztype = Z_TYPE_P(z);
}
switch (ztype) {
case IS_NULL:
Loaded 100 of 758 files, more files were not shown because too many files have changed in this diff. Show more