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";s:0:"";}';
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--
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)
30DONE
31