Commit Graph

11358 Commits

Author SHA1 Message Date
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
Andrea Faulds
5358c7cf5e Replace dead branch with ZEND_ASSERT() 2016-08-08 20:56:11 +01: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
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
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
Bob Weinand
6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Xinchen Hui
cbbe17fb53 Fixed typo 2016-07-20 17:01:42 +08:00
Xinchen Hui
97c0b133c5 Fixed bug #72629 (Caught exception assignment to variables ignores references). 2016-07-20 16:59:14 +08:00
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
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
Nikita Popov
a50a5c1bf1 Fix is_callable() on abstract method via object 2016-07-14 21:41:41 +02:00
Dmitry Stogov
99a5170781 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72286 (Segmentation fault During Garbage Collection)
2016-07-14 22:38:47 +03:00
Dmitry Stogov
1c84b55ade Fixed bug #72286 (Segmentation fault During Garbage Collection) 2016-07-14 22:37:25 +03:00
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
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
Dmitry Stogov
f80bb059b3 Fixed memory leak 2016-07-14 13:05:27 +03:00
Xinchen Hui
8c5b27e061 Fixed bug #72594 (Calling an earlier instance of an included anonymous class fatals) 2016-07-14 13:36:43 +08:00
Xinchen Hui
7903276f4c backport to 5.6 (we should not unset the default value) 2016-07-12 12:14:45 +08:00
Xinchen Hui
42902919bc Fixed bug #72581 (previous property undefined in Exception after deserialization) 2016-07-12 11:51:20 +08:00
Nikita Popov
8a555d7c66 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_compile.c
2016-07-05 14:32:38 +02:00
Pedro Magalhães
08777e9615 Don't enforce LSP if prototype method is private
Fixes bug #72496.
2016-07-05 14:30:22 +02:00
Nikita Popov
9b8f1d6037 Don't use FUNC_ARG fetches for call_user_func()
This makes no sense -- SEND_USER can't even handle INDIRECTs.
2016-06-28 21:34:20 +02:00
Nikita Popov
fafe01b07b Make call_user_func() on reference args consistent
Previously reference arguments were allowed if call_user_func()
was compiled to SEND_USER and not otherwise. Make it consistent
by always forbidding them.
2016-06-28 20:43:38 +02:00
Xinchen Hui
76370f30db Fixed test 2016-06-28 15:39:02 +08:00
Xinchen Hui
ce7e180a04 Fixed bug #72508 (strange references after recursive function call and "switch" statement) 2016-06-28 15:36:50 +08:00
Dmitry Stogov
3c84e5e1ce Allow "proxy" ovjects to substitute their class names through get_class_name() handler (similar to var_dump() and others). 2016-06-22 17:23:04 +03:00
Stanislav Malyshev
7dde353ee7 Merge branch 'PHP-5.5' into PHP-5.6.23
* PHP-5.5:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now

Conflicts:
	configure.in
	ext/mcrypt/mcrypt.c
	ext/spl/spl_directory.c
	main/php_version.h
2016-06-21 00:01:48 -07:00
Stanislav Malyshev
3f627e580a Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize 2016-06-20 21:26:33 -07:00
Nikita Popov
4746e5efcb Forbid "yield from" in force closed generators
Same check we do for "yield", was missed when "yield from" was
added. We could make this more granular by only forbidding to
actually yield values and still allow something like "yield from []",
but this does not seem worthwhile.
2016-05-28 13:21:05 +02:00
Xinchen Hui
d29bd582a8 Added NEWS Entry 2016-05-28 16:12:10 +08:00
Lauri Kenttä
58302192b7 Test for bug #72221, segfault in zend_memnstr_ex 2016-05-28 16:10:29 +08:00
Lauri Kenttä
287f9489d8 Fix bug #72221 (segfault, past-the-end access) 2016-05-28 16:10:16 +08:00
Stanislav Malyshev
544940c48a Merge branch 'PHP-5.5' into PHP-5.6.22
* PHP-5.5:
  Fix memory leak in imagescale()
  Update NEWS
  Better fix for bug #72135
  Fixed bug #72227: imagescale out-of-bounds read
  Fix bug #72241: get_icu_value_internal out-of-bounds read
  Fix bug #72135 - don't create strings with lengths outside int range
  Add check for string overflow to all string add operations
  Fix bug #72114 - int/size_t confusion in fread
  Updated NEWS
  Fixed bug #71331 - Uninitialized pointer in phar_make_dirstream()

Conflicts:
	Zend/zend_operators.c
	ext/phar/dirstream.c
	ext/phar/tests/bug71331.phpt
2016-05-24 16:56:36 -07:00
Anatol Belski
f751b1ceaf fix dir separator in test 2016-05-12 20:37:04 +02:00
Sara Golemon
a73b03edea Fix serializing ZEND_AST_SHELL_EXEC
Currently, `foo` is reserialized as `'foo'` due to misuse of zend_ast_export().
ZEND_AST_SHELL_EXEC can only contain ZEND_AST_ZVAL(string) or ZEND_AST_ENCAPS_LIST,
so just handle the ZEND_AST_ZVAL(string) case directly.
2016-05-12 02:47:56 +00:00
Anatol Belski
0718aa5833 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix handle leak
2016-05-10 20:02:17 +02:00
Anatol Belski
6b63d80a7a fix handle leak 2016-05-10 19:59:48 +02:00
Stanislav Malyshev
41fc3c76e9 Add check for string overflow to all string add operations 2016-05-09 22:17:20 -07:00
Xinchen Hui
69adf2370e Fixed test 2016-05-07 22:04:20 -07:00
Xinchen Hui
29079f263e Strlen cleanup (additions for previous one fix)
Probably compilers will do similar optimization
2016-05-07 00:08:15 -07:00
Xinchen Hui
f7439afeda Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	Zend/zend_strtod.c
2016-05-06 23:52:48 -07:00
Xinchen Hui
1c7f608071 Fixed bug #72172 (zend_hex_strtod should not use strlen) 2016-05-06 23:52:06 -07:00
Xinchen Hui
080f6b10ec Fixed test 2016-05-06 10:51:38 +08:00
Xinchen Hui
441d1b8ef0 Revert "Fix bug #72162 (again)"
The problem is because we release p->value too early

and later you try to convert an object to string, which is a fatal error

then leave p->value double free, change to expect long is a BC break

This reverts commit 8e5b381004.
2016-05-06 10:45:44 +08:00