1--TEST--
2Bug #25378 (unserialize() crashes with invalid data)
3--FILE--
4<?php
5var_dump(unserialize("s:-1:\"\";"));
6var_dump(unserialize("i:823"));
7var_dump(unserialize("O:8:\"stdClass :0:{}"));
8var_dump(unserialize("O:8:\"stdClass\"+0:{}"));
9var_dump(unserialize("O:1000:\"stdClass\":0:{}"));
10var_dump(unserialize("a:2:{i:0;s:2:\"12\":"));
11var_dump(unserialize("a:2:{i:0;s:2:\"12\";i:1;s:3000:\"123"));
12var_dump(unserialize("a:2:{i:0;s:2:\"12\"+i:1;s:3:\"123\";}"));
13var_dump(unserialize("a:2:{i:0;s:2:\"12\";i:1;s:3:\"123\";"));
14var_dump(unserialize("s:3000:\"123\";"));
15var_dump(unserialize("s:3000:\"123"));
16var_dump(unserialize("s:3:\"123;"));
17var_dump(unserialize("s:0:\"123\";"));
18?>
19===DONE===
20--EXPECTF--
21Notice: unserialize(): Error at offset 0 of 8 bytes in %sbug25378.php on line %d
22bool(false)
23
24Notice: unserialize(): Error at offset 0 of 5 bytes in %sbug25378.php on line %d
25bool(false)
26
27Notice: unserialize(): Error at offset 13 of 19 bytes in %sbug25378.php on line %d
28bool(false)
29
30Notice: unserialize(): Error at offset 14 of 19 bytes in %sbug25378.php on line %d
31bool(false)
32
33Notice: unserialize(): Error at offset 2 of 22 bytes in %sbug25378.php on line %d
34bool(false)
35
36Notice: unserialize(): Error at offset 17 of 18 bytes in %sbug25378.php on line %d
37bool(false)
38
39Notice: unserialize(): Error at offset 24 of 33 bytes in %sbug25378.php on line %d
40bool(false)
41
42Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
43bool(false)
44
45Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d
46bool(false)
47
48Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
49bool(false)
50
51Notice: unserialize(): Error at offset 2 of 11 bytes in %sbug25378.php on line %d
52bool(false)
53
54Notice: unserialize(): Error at offset 8 of 9 bytes in %sbug25378.php on line %d
55bool(false)
56
57Notice: unserialize(): Error at offset 5 of 10 bytes in %sbug25378.php on line %d
58bool(false)
59===DONE===
60