1--TEST--
2Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization
3--FILE--
4<?php
5class obj implements Serializable {
6    var $data;
7    function serialize() {
8        return serialize($this->data);
9    }
10    function unserialize($data) {
11        $this->data = unserialize($data);
12    }
13}
14
15$inner = 'a:1:{i:0;O:9:"Exception":2:{s:7:"'."\0".'*'."\0".'file";R:4;}';
16$exploit = 'a:2:{i:0;C:3:"obj":'.strlen($inner).':{'.$inner.'}i:1;R:4;}';
17
18var_dump(unserialize($exploit));
19?>
20DONE
21--EXPECTF--
22Notice: unserialize(): Unexpected end of serialized data in %sbug72663.php on line %d
23
24Notice: unserialize(): Error at offset 46 of 47 bytes in %sbug72663.php on line %d
25
26Notice: unserialize(): Error at offset 79 of 80 bytes in %sbug72663.php on line %d
27bool(false)
28DONE
29