mirror of
https://github.com/php/php-src.git
synced 2026-04-05 15:12:39 +02:00
Introduced by the recent switch to a zend_object. Unserialize the object into a tmp_var to avoid leaving behind a stack reference. Fixes oss-fuzz #29271.
34 lines
578 B
PHP
34 lines
578 B
PHP
--TEST--
|
|
Reference to SplObjectStorage key (not supported)
|
|
--FILE--
|
|
<?php
|
|
|
|
$inner = 'x:i:1;O:8:"stdClass":0:{};m:a:0:{}';
|
|
$inner_len = strlen($inner);
|
|
$str = <<<STR
|
|
a:2:{i:0;C:16:"SPlObjectStorage":{$inner_len}:{{$inner}}i:1;R:4;}
|
|
STR;
|
|
var_dump(unserialize($str));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
array(2) {
|
|
[0]=>
|
|
object(SplObjectStorage)#1 (1) {
|
|
["storage":"SplObjectStorage":private]=>
|
|
array(1) {
|
|
["%s"]=>
|
|
array(2) {
|
|
["obj"]=>
|
|
object(stdClass)#2 (0) {
|
|
}
|
|
["inf"]=>
|
|
NULL
|
|
}
|
|
}
|
|
}
|
|
[1]=>
|
|
object(stdClass)#2 (0) {
|
|
}
|
|
}
|