php-src/Zend/tests/is_callable_trampoline_uaf.phpt
Nikita Popov 429f194f40 Fix UAF in is_callable() and allocated trampoline
By nulling out the function_handler, so it will not get used
below. Reuse the existing helper for this purpose.
2020-01-30 11:04:59 +01:00

28 lines
459 B
PHP

--TEST--
is_callable() with trampoline should not caused UAF
--FILE--
<?php
class B {}
class A extends B {
public function bar($func) {
var_dump(is_callable(array('parent', 'foo')));
}
public function __call($func, $args) {
}
}
class X {
public static function __callStatic($func, $args) {
}
}
$a = new A();
// Extra X::foo() wrapper to force use of allocated trampoline.
X::foo($a->bar('foo'));
?>
--EXPECT--
bool(false)