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
18$data = unserialize($exploit);
19echo $data[1];
20?>
21DONE
22--EXPECTF--
23Notice: unserialize(): Unexpected end of serialized data in %sbug72663.php on line %d
24
25Notice: unserialize(): Error at offset 46 of 47 bytes in %sbug72663.php on line %d
26
27Notice: unserialize(): Error at offset 79 of 80 bytes in %sbug72663.php on line %d
28DONE
29