Commit Graph

2166 Commits

Author SHA1 Message Date
Xinchen Hui
a1c887964e Fixed bug #70944 (try{ } finally{} can create infinite chains of exceptions) 2015-11-20 16:24:53 +08:00
Anatol Belski
1934d6d9ab fix test title
c/p mistake :)
2015-11-15 00:03:40 +01:00
Taoguang Chen
617698dfe0 Fixed bug #70914 zend_throw_or_error() format string vulnerability 2015-11-14 23:44:59 +01:00
Xinchen Hui
25de928df7 Fixed bug #70912 (Null ptr dereference instantiating class with invalid array property) 2015-11-13 21:24:42 +08:00
Xinchen Hui
310fc87c2d SKIP on slow debug version PHP 2015-11-13 14:00:01 +08:00
Anatol Belski
cc10da474d fixed typo 2015-11-12 13:37:45 +01:00
Anatol Belski
9c4fd36783 add test for bug #70898 2015-11-12 09:28:10 +01:00
Xinchen Hui
53c03115cf Re-fixed #70895 2015-11-12 14:35:34 +08:00
Xinchen Hui
2bed2152e6 Revert "Fixed bug Bug #70895 null ptr deref and segfault"
This reverts commit 8eef11d317.
2015-11-12 14:34:00 +08:00
Anatol Belski
8eef11d317 Fixed bug Bug #70895 null ptr deref and segfault 2015-11-12 00:52:36 +01:00
Anatol Belski
b89f451694 adjust test expectation 2015-11-11 09:47:29 +01:00
Anatol Belski
3cdc438e53 fix test filename and title 2015-11-11 09:47:24 +01:00
Dmitry Stogov
d66d1b97aa Fixed incorrect order of free/finally on exception 2015-11-10 10:10:39 +03:00
Anatol Belski
2e38918ba4 add test for eb32da13 2015-11-09 22:45:22 +01:00
Dmitry Stogov
c9eacb181c Added tests 2015-11-09 23:54:09 +03:00
Xinchen Hui
2d8d97cee2 Fixed bug #70873 (Regression on private static properties access) 2015-11-07 06:50:36 -08:00
Nikita Popov
99d818f1e9 Don't propagate into ops that error on non-string
To properly support this make update_opN_const fallible -- they
are not always called through replace_with_const.
2015-11-07 12:04:51 +01:00
Nikita Popov
00b37e718d Strip leading backslash in update_opN_const 2015-11-07 12:04:51 +01:00
Nikita Popov
632bee4abb Fix update_opX_const lowercasing
It was lowering in-place.
2015-11-07 12:04:51 +01:00
Xinchen Hui
27aef97f65 Fixed bug #70868 (PCRE JIT and pattern reuse segfault) 2015-11-06 11:37:17 +08:00
Márcio Almada
283b6275df add failing test for bug #70868 2015-11-06 11:34:45 +08:00
Xinchen Hui
2f2653aa77 Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite) 2015-11-03 17:53:56 -08:00
Xinchen Hui
227c898cd9 Fixed test 2015-11-02 10:58:55 +08:00
Xinchen Hui
37ed0dafe4 Fixed bug #70828 (php-fpm 5.6 with opcache crashes when referencing a non-existent constant) 2015-11-02 10:47:02 +08:00
Xinchen Hui
5767f2b648 Fixed bug #70785 (Infinite loop due to exception during identical comparison) 2015-10-26 11:15:17 +08:00
Nikita Popov
b9cc3176eb Fix bug #70782 2015-10-24 23:19:02 +02:00
Xinchen Hui
c7cb40353c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_ini_scanner.c
2015-10-20 13:26:02 +08:00
Xinchen Hui
d5f76caf6c Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l) 2015-10-20 13:20:56 +08:00
Aaron Piotrowski
c100a742dc Fix missed assertion tests 2015-10-18 02:23:43 -05:00
Nikita Popov
e3e92e96c1 Fixed bug #70430 2015-10-15 22:14:23 +02:00
Bob Weinand
60b4355168 Do not create a fake Closure for real Closures
That is solved by just returning the Closure as is, which is safe due to Closures being immutable objects
2015-10-14 12:07:33 +02:00
Xinchen Hui
a8ae88162f Fixed bug #70689 (Exception handler does not work as expected) 2015-10-13 17:40:58 +08:00
Nikita Popov
7597a06562 Add more tests for closure binding 2015-10-12 20:37:14 +02:00
Dmitry Stogov
23b372d358 Forbid "fake" closure rebinding 2015-10-12 20:34:08 +02:00
Nikita Popov
c85ad5d0be Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_closures.c
2015-10-10 15:00:41 +02:00
Nikita Popov
d7d01fc9a3 Fixed bug #70685
Doing a less intrusive variant of the PHP 7.0 fix for 5.6.
2015-10-10 14:59:21 +02:00
Nikita Popov
4b821f0fc6 Normalize rebinding failures
Move all rebinding checks into one function to make sure they stay
in sync. Normalize return value to be NULL for all rebinding
failures, instead of returning an improperly bound closure in some
cases.
2015-10-10 13:56:36 +02:00
Nikita Popov
d677b25b1c Merge branch 'PHP-5.6' into PHP-7.0 2015-10-09 23:28:58 +02:00
Nikita Popov
e19423f3cb Improve previous fix
Don't forbid null binding on plain functions.
2015-10-09 23:28:24 +02:00
Nikita Popov
f6ae19f158 Merge branch 'PHP-5.6' into PHP-7.0 2015-10-09 23:06:32 +02:00
Nikita Popov
bbae7ddf29 Fixed bug #70681 2015-10-09 23:01:23 +02:00
Dmitry Stogov
0847681b1a Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure()) 2015-10-09 11:48:13 +03:00
Nikita Popov
cc3c425af8 Fix bug #70662
This replaces add_new with update for the RW case. This should not
be problematic for performance, as this branch throws a notice.

Alternatively add_new could also be replaced with add. I went with
update, because it makes $a[0] += 1 behavior the same as
$a[0] = $a[0] + 1.
2015-10-08 11:03:39 +02:00
Dmitry Stogov
e0b3b3c752 Revert "Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())"
This reverts commit 517b553625.
2015-10-06 23:59:36 +03:00
Dmitry Stogov
e193d35c1e Revert "Improve 517b55362 (scope rebinding on method Closures)"
This reverts commit 881c502520.
2015-10-06 23:48:15 +03:00
Dmitry Stogov
524d00e005 Revert "Allow random $this on non-internal Closures again"
This reverts commit 35d0405c47.
2015-10-06 23:48:10 +03:00
Bob Weinand
35d0405c47 Allow random $this on non-internal Closures again
As it turns out, there is actually no reason to prevent this, it even was a bigger BC break than expected...

Also fixes a memory leak (the Closure leaks) when calling internal functions via Closure by moving it out of leave helper onto caller side for TOP_CODE:

$z = new SplStack; $z->push(20);
$x = (new ReflectionMethod("SplStack", "pop"))->getClosure($z);
var_dump($x());
2015-10-05 17:49:32 +02:00
Bob Weinand
881c502520 Improve 517b55362 (scope rebinding on method Closures)
Now it is completely impossible to rebind a scoped method Closure (only the kind you get from ReflectionMethod::getClosure()) to a foreign scope
Adding a lot of tests to ensure this...
Also, properly return NULL in case the Closure could not be created instead of some crippled unbound Closure
2015-10-05 00:56:55 +02:00
Bob Weinand
517b553625 Fixed bug #70630 (Closure::call/bind() crash with ReflectionFunction->getClosure())
This additionally removes support for binding to an unknown (not in parent hierarchy) scope.
Removing support for cross-scope is necessary for certain compile-time assumptions (like class constants) to prevent unexpected results
2015-10-04 01:38:59 +02:00
Dmitry Stogov
62c96059a2 Fixed memory leak. 2015-09-23 23:16:30 +03:00
Dmitry Stogov
a6509a6fdd Fixed test 2015-09-23 13:18:30 +03:00
Xinchen Hui
1e3333e4bd Fixed Bug #70557 (Memleak on return type verifying failed) 2015-09-23 14:10:23 +08:00
Xinchen Hui
504cd492e1 Fixed bug #70548 (Redundant information printed in case of uncaught engine exception) 2015-09-23 13:04:33 +08:00
Xinchen Hui
a9636ff5a2 Fixed bug #70555 (fun_get_arg() on unsetted vars return UNKNOW)
and also keep the indices of func_get_args(). since they are similar
issue of #70574, thus reuse its test script.
2015-09-23 10:00:20 +08:00
Xinchen Hui
0f3ab1c2d0 Fixed #70547 similar bug in func_get_args 2015-09-22 13:58:42 +08:00
Xinchen Hui
e1dcfd2cf9 Fixed bug #70547 (unsetting function variables corrupts backtrace) 2015-09-22 11:59:35 +08:00
Xinchen Hui
bb07905a4a Fixed bug #70528 (assert() with instanceof adds apostrophes around class name) 2015-09-19 19:49:36 -07:00
Bob Weinand
b0174a14c0 Fixed bug #70478 (**= does no longer work)
Reordered ZEND_(ASSIGN_)POW opcodes in zend_vm_def.h so that it won't be missed in future
2015-09-12 00:54:48 +02:00
Márcio Almada
c08b3922dd adds missing tokens to list of semi-reserved words and regenerates test suite 2015-09-04 15:02:50 +02:00
Xinchen Hui
d5b78cec64 We should keep one refcount to resource 2015-09-02 22:14:48 -07:00
Xinchen Hui
6815c08e29 Fixed bug #70398 (SIGSEGV, Segmentation fault zend_ast_destroy_ex) 2015-09-02 22:07:29 -07:00
Bob Weinand
50d6fd6a03 Fixed bug #70397 (Segmentation fault when using Closure::call and yield) 2015-09-01 18:04:19 +02:00
Dmitry Stogov
bb4b50636c Fixed one more problem related to bug #70187 (Notice: unserialize(): Unexpected end of serialized data) 2015-09-01 10:39:00 +03:00
Nikita Popov
ccec609b82 Fix bug #62441
These checks were introduced by 8646d9afce
back when name resolution was working differently.
2015-08-28 19:00:05 +02:00
Dmitry Stogov
25f9e25526 Fixed bug #70187 (Notice: unserialize(): Unexpected end of serialized data) 2015-08-26 03:27:05 +03:00
Xinchen Hui
f56534e4b9 Fixed Bug #70332 (Wrong behavior while returning reference on object)
This fix is actually made for array acessing bug fix (#70262) which is
discarded since we have another better fix, anyway now seems this is still useful
2015-08-23 20:17:51 +08:00
Xinchen Hui
55f88141c5 Re-Fixed bug #70321 (Magic getter breaks reference to array property) 2015-08-23 11:42:33 +08:00
Xinchen Hui
e26a04f9ec Revert "Fixed bug #70321 (Magic getter breaks reference to array property)"
This reverts commit 66754585f8.
2015-08-23 10:40:28 +08:00
Bob Weinand
66754585f8 Fixed bug #70321 (Magic getter breaks reference to array property)
Note that the UNEXPECTED(zv) was turned into EXPECTED(zv), as zv is mostly set in the context where it is used and usually anyway is checked first with OP*_TYPE == IS_VAR; or maybe just completely remove that (UN)EXPECTED at this place...
2015-08-22 23:54:59 +01:00
Nikita Popov
ef7d822c32 Remove path from test 2015-08-20 12:58:36 +02:00
Nikita Popov
186b0f3770 Don't allow leading \ in group use decl list
We recently added support for "use \Foo\{Bar}". This commit drops
support for the reverse "use Foo\{\Bar}". Those two got mixed up
in the initial implementation.
2015-08-20 11:47:43 +02:00
Márcio Almada
7568d5cb89 fixes a syntactical inconsistency with group use and leading \
discussion: http://news.php.net/php.internals/87774
2015-08-18 19:23:58 -03:00
Joe Watkins
784dd715e4 Fix mangled property names on anon classes 2015-08-18 16:37:38 +01:00
Xinchen Hui
e543769fa4 Fixed bug #70288 (Apache crash related to ZEND_SEND_REF) 2015-08-18 21:45:19 +08:00
Bob Weinand
34834c58fa Fixed bug #70293 (Crash with specific assertions and zend.assertions=-1) 2015-08-18 15:01:24 +02:00
Xinchen Hui
75198c7371 Merge branch 'master' of git.php.net:php-src 2015-08-18 19:07:26 +08:00
Bob Weinand
c83cbdf6ce Better fix for exception traces truncation with anon classes 2015-08-18 12:48:06 +02:00
Xinchen Hui
8df3461086 Improved fix for bug #70262 2015-08-18 18:07:31 +08:00
Xinchen Hui
14ea398d78 It should not be skip 2015-08-18 18:04:26 +08:00
Xinchen Hui
685fee75a5 Skip the test with valgrind 2015-08-18 18:03:34 +08:00
Dmitry Stogov
ce89fd9758 Fixed bug #70262 (Accessing array crashes PHP 7.0beta3) 2015-08-17 12:58:14 +03:00
Xinchen Hui
a089ce0cc6 Fixed bug #70258 and #70253 2015-08-13 12:08:57 +08:00
Bob Weinand
dbd8edbbd0 Fixed bug #70241 (Skipped assertions affect Generator returns) 2015-08-11 22:12:06 +02:00
Steven Hilder
de5d4d7b42 Add test: unmangling private properties in anon class instances 2015-08-06 16:56:05 +00:00
Stanislav Malyshev
97047e7665 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  fix test
  update NEWS
  Fix bug #70019 - limit extracted files to given directory
  Do not do convert_to_* on unserialize, it messes up references
  Fix #69793 - limit what we accept when unserializing exception
  Fixed bug #70169 (Use After Free Vulnerability in unserialize() with SplDoublyLinkedList)
  Fixed bug #70166 - Use After Free Vulnerability in unserialize() with SPLArrayObject
  ignore signatures for packages too
  Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage
  Fixed bug #69892
  Fix bug #70014 - use RAND_bytes instead of deprecated RAND_pseudo_bytes
  Improved fix for Bug #69441
  Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
  Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
  Fix bug #70081: check types for SOAP variables

Conflicts:
	Zend/zend_exceptions.c
	ext/date/php_date.c
	ext/openssl/openssl.c
	ext/phar/phar_internal.h
	ext/soap/php_http.c
	ext/spl/spl_array.c
	ext/spl/spl_dllist.c
	ext/spl/spl_observer.c
	ext/standard/tests/serialize/bug69152.phpt
	sapi/cli/tests/005.phpt
2015-08-04 16:14:24 -07:00
Stanislav Malyshev
ed709d5aa0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  fix test
  update NEWS
  Fix bug #70019 - limit extracted files to given directory
  Do not do convert_to_* on unserialize, it messes up references
  Fix #69793 - limit what we accept when unserializing exception
  Fixed bug #70169 (Use After Free Vulnerability in unserialize() with SplDoublyLinkedList)
  Fixed bug #70166 - Use After Free Vulnerability in unserialize() with SPLArrayObject
  ignore signatures for packages too
  Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage
  Fixed bug #69892
  Fix bug #70014 - use RAND_bytes instead of deprecated RAND_pseudo_bytes
  Improved fix for Bug #69441
  Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
  Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
  Fix bug #70081: check types for SOAP variables

Conflicts:
	ext/soap/php_http.c
	ext/spl/spl_observer.c
2015-08-04 15:29:13 -07:00
Stanislav Malyshev
69ed3969dd Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #70019 - limit extracted files to given directory
  Do not do convert_to_* on unserialize, it messes up references
  Fix #69793 - limit what we accept when unserializing exception
  Fixed bug #70169 (Use After Free Vulnerability in unserialize() with SplDoublyLinkedList)
  Fixed bug #70166 - Use After Free Vulnerability in unserialize() with SPLArrayObject
  ignore signatures for packages too
  Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage
  Fixed bug #69892
  Fix bug #70014 - use RAND_bytes instead of deprecated RAND_pseudo_bytes
  Improved fix for Bug #69441
  Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
  Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
  Fix bug #70081: check types for SOAP variables

Conflicts:
	.gitignore
	ext/date/php_date.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
2015-08-04 14:10:57 -07:00
Stanislav Malyshev
51f9a00b47 Merge branch 'PHP-5.4' into PHP-5.4.44
* PHP-5.4:
  Fixed bug #69892
  Adjust Git-Rules
2015-08-04 14:04:24 -07:00
Dmitry Stogov
a16aa4c42c Move most "finally" related code-generation from pass_two() to compiler. 2015-08-04 07:42:28 +03:00
Nikita Popov
743801054d Try to fix finally issue 2015-08-04 07:42:28 +03:00
Bob Weinand
9e246a73ef Fixed bug #70182 (Segfault in ZEND_ASSIGN_OP handlers) 2015-08-02 19:08:39 +02:00
Hugh Davenport
2a1a8f9ea7 Fixed bug #70183 null pointer deref (segfault) in zend_eval_const_expr 2015-08-02 16:51:23 +02:00
Nikita Popov
7fc04937f5 Fixed bug #69892 2015-08-01 20:47:43 -07:00
Bob Weinand
2d6f0e4584 Fix bug #70179 ($this refcount issue) 2015-08-01 20:35:56 +02:00
Bob Weinand
d45d5271f7 Fix bug #70164 (__COMPILER_HALT_OFFSET__ under namespace is not defined) 2015-07-29 19:18:29 +02:00
Julien Pauli
a28115ccdb Fix for #70159 - Better magic constants substitution 2015-07-28 16:30:08 +02:00
Xinchen Hui
0bddc18619 Fixed bug #70156 (Segfault in zend_find_alias_name) 2015-07-28 16:39:58 +08:00
Stanislav Malyshev
e488690d95 Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref) 2015-07-26 17:10:24 -07:00
Nikita Popov
a717acd21a Fix RECV_VARIADIC literal compacting wrt cache slot 2015-07-26 21:22:31 +02:00
Bob Weinand
7ca85d8875 Fully fix typed generator returns 2015-07-24 22:04:05 +02:00