1--TEST--
2Bug #72663 (2): Don't allow references into failed unserialize
3--FILE--
4<?php
5
6class obj implements Serializable {
7    public $data;
8    function serialize() {
9        return serialize($this->data);
10    }
11    function unserialize($data) {
12        $this->data = unserialize($data);
13    }
14}
15
16$inner = 'a:1:{i:0;O:9:"Exception":2:{s:7:"'."\0".'*'."\0".'file";s:0:"";}';
17$exploit = 'a:2:{i:0;C:3:"obj":'.strlen($inner).':{'.$inner.'}i:1;R:4;}';
18var_dump(unserialize($exploit));
19
20?>
21--EXPECTF--
22Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d
23
24Warning: unserialize(): Unexpected end of serialized data in %s on line %d
25
26Warning: unserialize(): Error at offset 49 of 50 bytes in %s on line %d
27
28Warning: unserialize(): Error at offset 82 of 83 bytes in %s on line %d
29bool(false)
30