1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/oss_fuzz_438780145.phpt
Ilija Tovilo 19b30032c9 Fix uaf for nested finally with repeated return type check
Fixes OSS-Fuzz #438780145
Closes GH-19488
2026-01-16 18:38:24 +01:00

28 lines
470 B
PHP

--TEST--
OSS-Fuzz #438780145: Nested finally with repeated return type check may uaf
--FILE--
<?php
function &test(): int {
$x = 0;
try {
return $x;
} finally {
try {
return $x;
} finally {
$x = "";
}
}
}
test();
?>
--EXPECTF--
Fatal error: Uncaught TypeError: test(): Return value must be of type int, string returned in %s:%d
Stack trace:
#0 %s(%d): test()
#1 {main}
thrown in %s on line %d