diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/standard/tests/serialize/002.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/standard/tests/serialize/002.phpt')
-rw-r--r-- | ext/standard/tests/serialize/002.phpt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/standard/tests/serialize/002.phpt b/ext/standard/tests/serialize/002.phpt new file mode 100644 index 0000000..3085d1c --- /dev/null +++ b/ext/standard/tests/serialize/002.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #25378 (unserialize() crashes with invalid data) +--FILE-- +<?php +var_dump(unserialize('b:0;')); +var_dump(unserialize('b:1;')); +var_dump(unserialize('i:823;')); +var_dump(unserialize('s:0:"";')); +var_dump(unserialize('s:3:"foo";')); +var_dump(unserialize('a:1:{i:0;s:2:"12";}')); +var_dump(unserialize('a:2:{i:0;a:0:{}i:1;a:0:{}}')); +var_dump(unserialize('a:3:{i:0;s:3:"foo";i:1;s:3:"bar";i:2;s:3:"baz";}')); +var_dump(unserialize('O:8:"stdClass":0:{}')); +?> +===DONE=== +--EXPECTF-- +bool(false) +bool(true) +int(823) +string(0) "" +string(3) "foo" +array(1) { + [0]=> + string(2) "12" +} +array(2) { + [0]=> + array(0) { + } + [1]=> + array(0) { + } +} +array(3) { + [0]=> + string(3) "foo" + [1]=> + string(3) "bar" + [2]=> + string(3) "baz" +} +object(stdClass)#%d (0) { +} +===DONE=== |