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";R:4;}';
17$exploit = 'a:2:{i:0;C:3:"obj":'.strlen($inner).':{'.$inner.'}i:1;R:4;}';
18var_dump(unserialize($exploit));
19
20?>
21--EXPECTF--
22Notice: unserialize(): Unexpected end of serialized data in %s on line %d
23
24Notice: unserialize(): Error at offset 46 of 47 bytes in %s on line %d
25
26Notice: unserialize(): Error at offset 79 of 80 bytes in %s on line %d
27bool(false)
28