com php-src: Added test for (long-ago fixed) bug #70083: Zend/tests/bug70083.phpt

From: Date: Tue, 22 Dec 2015 16:39:36 +0000
Subject: com php-src: Added test for (long-ago fixed) bug #70083: Zend/tests/bug70083.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90396@lists.php.net to get a copy of this message
Commit: 3e3d0290ff245393c0f0eda9146a685c8a9fad3d Author: Bob Weinand <bobwei9@hotmail.com> Tue, 22 Dec 2015 17:39:36 +0100 Parents: 897bf916bc24446429d3b619f5cb93ea3a2fe2a3 Branches: PHP-7.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3e3d0290ff245393c0f0eda9146a685c8a9fad3d Log: Added test for (long-ago fixed) bug #70083 Bugs: https://bugs.php.net/70083 Changed paths: A Zend/tests/bug70083.phpt Diff: diff --git a/Zend/tests/bug70083.phpt b/Zend/tests/bug70083.phpt new file mode 100644 index 0000000..0391ea2 --- /dev/null +++ b/Zend/tests/bug70083.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #70083 (Use after free with assign by ref to overloaded objects) +--FILE-- +<?php + +class foo { + private $var; + function __get($e) { + return $this; + } +} + +function &noref() { $foo = 1; return $foo; } + +$foo = new foo; +$foo->i = &noref(); +var_dump($foo); + +?> +--EXPECTF-- + +Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d +

« previous php.cvs (#90396) next »