mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Promote unserialize() notices to warning (#9629)
* Unserialize: Migrate "Unexpected end of serialized data" to E_WARNING * Unserialize: Migrate "Error at offset %d of %d bytes" to E_WARNING * Unserialize: Migrate "%s is returned from __sleep() multiple times" to E_WARNING * Add NEWS for “Promote unserialize() notices to warning”
This commit is contained in:
parent
d0d834429f
commit
dd8de1e726
48 changed files with 93 additions and 86 deletions
3
NEWS
3
NEWS
|
@ -61,6 +61,9 @@ PHP NEWS
|
||||||
. Added SKF_AD_QUEUE for cbpf filters. (David Carlier)
|
. Added SKF_AD_QUEUE for cbpf filters. (David Carlier)
|
||||||
. Added socket_atmark if send/recv needs using MSG_OOB. (David Carlier)
|
. Added socket_atmark if send/recv needs using MSG_OOB. (David Carlier)
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. E_NOTICEs emitted by unserialized() have been promoted to E_WARNING. (timwolla)
|
||||||
|
|
||||||
- Streams:
|
- Streams:
|
||||||
. Fixed bug #51056: blocking fread() will block even if data is available.
|
. Fixed bug #51056: blocking fread() will block even if data is available.
|
||||||
(Jakub Zelenka)
|
(Jakub Zelenka)
|
||||||
|
|
|
@ -47,6 +47,10 @@ PHP 8.3 UPGRADE NOTES
|
||||||
"buffer_size" => int
|
"buffer_size" => int
|
||||||
See GH-9336
|
See GH-9336
|
||||||
|
|
||||||
|
- Standard:
|
||||||
|
. E_NOTICEs emitted by unserialized() have been promoted to E_WARNING.
|
||||||
|
RFC: https://wiki.php.net/rfc/improve_unserialize_error_handling
|
||||||
|
|
||||||
========================================
|
========================================
|
||||||
6. New Functions
|
6. New Functions
|
||||||
========================================
|
========================================
|
||||||
|
|
|
@ -5,4 +5,4 @@ Bug #70253 (segfault at _efree () in zend_alloc.c:1389)
|
||||||
unserialize('a:2:{i:0;O:9:"000000000":10000000');
|
unserialize('a:2:{i:0;O:9:"000000000":10000000');
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 33 of 33 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 33 of 33 bytes in %s on line %d
|
||||||
|
|
|
@ -14,5 +14,5 @@ var_dump(unserialize('E:7:"Foo:Baz";'));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: unserialize(): Foo::Baz is not an enum case in %s on line %d
|
Warning: unserialize(): Foo::Baz is not an enum case in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 14 of 14 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 14 of 14 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -13,5 +13,5 @@ var_dump(unserialize('E:6:"FooBar";'));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: unserialize(): Invalid enum name 'FooBar' (missing colon) in %s on line %d
|
Warning: unserialize(): Invalid enum name 'FooBar' (missing colon) in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 13 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 13 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -11,5 +11,5 @@ var_dump(unserialize('E:7:"Foo:Bar";'));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: unserialize(): Class 'Foo' is not an enum in %s on line %d
|
Warning: unserialize(): Class 'Foo' is not an enum in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 14 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 14 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -13,5 +13,5 @@ var_dump(unserialize('E:7:"Foo:Baz";'));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: unserialize(): Undefined constant Foo::Baz in %s on line %d
|
Warning: unserialize(): Undefined constant Foo::Baz in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 14 of 14 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 14 of 14 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -8,5 +8,5 @@ $str = 'C:3:"GMP":4:{s:6666666666:""}';
|
||||||
var_dump(unserialize($str));
|
var_dump(unserialize($str));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 13 of 29 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 13 of 29 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -79,7 +79,7 @@ Calling getMetadata with too low max_depth
|
||||||
|
|
||||||
Warning: Phar::getMetadata(): Maximum depth of 1 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %sphar_metadata_write3.php on line 39
|
Warning: Phar::getMetadata(): Maximum depth of 1 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %sphar_metadata_write3.php on line 39
|
||||||
|
|
||||||
Notice: Phar::getMetadata(): Error at offset 34 of 59 bytes in %sphar_metadata_write3.php on line 39
|
Warning: Phar::getMetadata(): Error at offset 34 of 59 bytes in %sphar_metadata_write3.php on line 39
|
||||||
bool(false)
|
bool(false)
|
||||||
Calling getMetadata with some allowed classes
|
Calling getMetadata with some allowed classes
|
||||||
In wakeup
|
In wakeup
|
||||||
|
|
|
@ -40,7 +40,7 @@ function ptr2str($ptr)
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s%ebug72562.php on line %d
|
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s%ebug72562.php on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 1 bytes in %s%ebug72562.php on line %d
|
Warning: unserialize(): Error at offset 0 of 1 bytes in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 4 of 4 bytes in %s%ebug72562.php on line %d
|
Warning: unserialize(): Error at offset 4 of 4 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -157,7 +157,7 @@ Deprecated: %s implements the Serializable interface, which is deprecated. Imple
|
||||||
|
|
||||||
Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d
|
Warning: Erroneous data format for unserializing 'TestNANew' in %s005.php on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 19 of 20 bytes in %s005.php on line %d
|
Warning: unserialize(): Error at offset 19 of 20 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
===NANew2===
|
===NANew2===
|
||||||
unserializer(TestNANew2)
|
unserializer(TestNANew2)
|
||||||
|
|
|
@ -11,7 +11,7 @@ var_dump(unserialize('O:4:"Test":1:{}'));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Unexpected end of serialized data in %s on line %d
|
Warning: unserialize(): Unexpected end of serialized data in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 14 of 15 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 14 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -17,41 +17,41 @@ var_dump(unserialize("s:3:\"123;"));
|
||||||
var_dump(unserialize("s:0:\"123\";"));
|
var_dump(unserialize("s:0:\"123\";"));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 0 of 8 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 0 of 8 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 5 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 0 of 5 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 13 of 19 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 13 of 19 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 14 of 19 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 14 of 19 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2 of 22 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 2 of 22 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 17 of 18 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 17 of 18 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 24 of 33 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 24 of 33 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 17 of 33 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 17 of 33 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 32 of 32 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 32 of 32 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2 of 13 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 2 of 13 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2 of 11 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 2 of 11 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 8 of 9 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 8 of 9 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 5 of 10 bytes in %sbug25378.php on line %d
|
Warning: unserialize(): Error at offset 5 of 10 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -10,5 +10,5 @@ Warning: unserialize(): %s in %sbug68044.php on line %d
|
||||||
|
|
||||||
Warning: Insufficient data for unserializing - %d required, 1 present in %s%ebug68044.php on line 2
|
Warning: Insufficient data for unserializing - %d required, 1 present in %s%ebug68044.php on line 2
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 32 of 33 bytes in %s%ebug68044.php on line 2
|
Warning: unserialize(): Error at offset 32 of 33 bytes in %s on line %d
|
||||||
===DONE==
|
===DONE==
|
||||||
|
|
|
@ -5,5 +5,5 @@ Bug #68545 NULL pointer dereference in unserialize.c:var_push_dtor
|
||||||
var_dump(unserialize('a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"b22";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";s:3:"bar";'));
|
var_dump(unserialize('a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"b22";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";a:6:{a:6:{s:3:"322";s:3:"bar";s:3:"bar";s:3:"foo";s:3:"bar";s:3:"bar";'));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset %d of %d bytes in %sbug68545.php on line %d
|
Warning: unserialize(): Error at offset 10 of 310 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -15,7 +15,7 @@ var_dump(unserialize('a:2:{i:0;i:42;i:1;O:4:"evil":0:{}}'));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 4 of 4 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 4 of 4 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Warning: unserialize(): Function evil() hasn't defined the class it was called for in %s on line %d
|
Warning: unserialize(): Function evil() hasn't defined the class it was called for in %s on line %d
|
||||||
|
|
|
@ -31,5 +31,5 @@ var_dump($data);
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 55 of 56 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 55 of 56 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -48,8 +48,8 @@ DONE
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Deprecated: %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
|
Deprecated: %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
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 3 bytes in %sbug70436.php on line %d
|
Warning: unserialize(): Error at offset 0 of 3 bytes in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 93 of 94 bytes in %sbug70436.php on line %d
|
Warning: unserialize(): Error at offset 93 of 94 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
DONE
|
DONE
|
||||||
|
|
|
@ -5,5 +5,5 @@ Bug #71840 (Unserialize accepts wrongly data)
|
||||||
var_dump(unserialize('a:1:{s:0:""0a:0:{}}'));
|
var_dump(unserialize('a:1:{s:0:""0a:0:{}}'));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 11 of 19 bytes in %sbug71840.php on line %d
|
Warning: unserialize(): Error at offset 11 of 19 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -18,7 +18,7 @@ var_dump($s);
|
||||||
var_dump(unserialize($s));
|
var_dump(unserialize($s));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: serialize(): "b" is returned from __sleep() multiple times in %s on line %d
|
Warning: serialize(): "b" is returned from __sleep() multiple times in %s on line %d
|
||||||
string(39) "O:1:"A":1:{s:1:"b";O:8:"stdClass":0:{}}"
|
string(39) "O:1:"A":1:{s:1:"b";O:8:"stdClass":0:{}}"
|
||||||
object(A)#%d (1) {
|
object(A)#%d (1) {
|
||||||
["b"]=>
|
["b"]=>
|
||||||
|
|
|
@ -49,10 +49,10 @@ try {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 17 of 24 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 17 of 24 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 25 of 32 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 25 of 32 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
Caught
|
Caught
|
||||||
Caught
|
Caught
|
||||||
|
|
|
@ -21,9 +21,9 @@ var_dump(unserialize($exploit));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Deprecated: %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
|
Deprecated: %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
|
||||||
|
|
||||||
Notice: unserialize(): Unexpected end of serialized data in %s on line %d
|
Warning: unserialize(): Unexpected end of serialized data in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 49 of 50 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 49 of 50 bytes in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 82 of 83 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 82 of 83 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -12,7 +12,7 @@ session_decode($sess);
|
||||||
var_dump($_SESSION);
|
var_dump($_SESSION);
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: session_decode(): Unexpected end of serialized data in %s on line %d
|
Warning: session_decode(): Unexpected end of serialized data in %s on line %d
|
||||||
|
|
||||||
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
||||||
array(0) {
|
array(0) {
|
||||||
|
|
|
@ -14,5 +14,5 @@ $poc = 'O:3:"obj":1:{';
|
||||||
var_dump(unserialize($poc));
|
var_dump(unserialize($poc));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 13 of 13 bytes in %sbug73052.php on line %d
|
Warning: unserialize(): Error at offset 13 of 13 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -20,5 +20,5 @@ unserialize($exploit);
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Error at offset 6 of 7 bytes
|
Error at offset 6 of 7 bytes
|
||||||
|
|
||||||
Notice: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d
|
Warning: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d
|
||||||
Error at offset 24 of 34 bytes
|
Error at offset 24 of 34 bytes
|
||||||
|
|
|
@ -8,5 +8,5 @@ var_dump($obj);
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: Bad unserialize data in %sbug73825.php on line %d
|
Warning: Bad unserialize data in %sbug73825.php on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 13 of 15 bytes in %sbug73825.php on line %d
|
Warning: unserialize(): Error at offset 13 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -8,5 +8,5 @@ var_dump(unserialize($s));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: unserialize(): %s in %sbug74101.php on line %d
|
Warning: unserialize(): %s in %sbug74101.php on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 46 of 74 bytes in %sbug74101.php on line %d
|
Warning: unserialize(): Error at offset 46 of 74 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -5,5 +5,5 @@ Bug #74103: heap-use-after-free when unserializing invalid array size
|
||||||
var_dump(unserialize('a:7:{i:0;i:04;s:1:"a";i:2;i:9617006;i:4;s:1:"a";i:4;s:1:"a";R:5;s:1:"7";R:3;s:1:"a";R:5;;s:18;}}'));
|
var_dump(unserialize('a:7:{i:0;i:04;s:1:"a";i:2;i:9617006;i:4;s:1:"a";i:4;s:1:"a";R:5;s:1:"7";R:3;s:1:"a";R:5;;s:18;}}'));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset %d of %d bytes in %s on line %d
|
Warning: unserialize(): Error at offset 64 of 96 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -6,5 +6,5 @@ $s = 'O:8:"stdClass":00000000';
|
||||||
var_dump(unserialize($s));
|
var_dump(unserialize($s));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 25 of 23 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 25 of 23 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -10,5 +10,5 @@ var_dump(unserialize('d:2e++2;'));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
float(200)
|
float(200)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 8 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 8 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -9,4 +9,4 @@ unserialize('a:3020000000000000000000000000000001:{i:0;a:0:{}i:1;i:2;i:2;i:3;i:3
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Warning: unserialize(): %s in %sbug74614.php on line %d
|
Warning: unserialize(): %s in %sbug74614.php on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset %d of 113 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 38 of 113 bytes in %s on line %d
|
||||||
|
|
|
@ -8,5 +8,5 @@ $poc .= '000";R:2;s:4:"0000";d:0;s:4:"0000";a:9:{s:4:"0000";';
|
||||||
var_dump(unserialize($poc));
|
var_dump(unserialize($poc));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 43 of 145 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 43 of 145 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -50,4 +50,4 @@ Serialization of 'class@anonymous' is not allowed
|
||||||
Unserialization of 'MySplFileInfo' is not allowed
|
Unserialization of 'MySplFileInfo' is not allowed
|
||||||
Unserialization of 'MySplFileInfo' is not allowed
|
Unserialization of 'MySplFileInfo' is not allowed
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of %d bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of %d bytes in %s on line %d
|
||||||
|
|
|
@ -18,38 +18,38 @@ var_dump(unserialize('a:1:{i:0;R:-1;}'));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 0 of 9 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 9 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 9 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 9 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 7 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 7 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 7 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 7 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 20 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 20 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 20 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 20 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 24 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 24 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 24 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 24 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 9 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -115,28 +115,28 @@ bool(true)
|
||||||
|
|
||||||
Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
Object:
|
Object:
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
||||||
Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2834 of 2971 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 2834 of 2971 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
Ini setting:
|
Ini setting:
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
||||||
Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
Warning: unserialize(): Maximum depth of 128 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
Ini setting overridden:
|
Ini setting overridden:
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
||||||
Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Deprecated: %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
|
Deprecated: %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
|
||||||
|
@ -144,7 +144,7 @@ Nested unserialize combined depth limit:
|
||||||
|
|
||||||
Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 1157 of 1294 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
|
@ -154,7 +154,7 @@ Nested unserialize overridden depth limit:
|
||||||
|
|
||||||
Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
Warning: unserialize(): Maximum depth of 256 exceeded. The depth limit can be changed using the max_depth unserialize() option or the unserialize_max_depth ini setting in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 2309 of 2574 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
|
|
|
@ -32,7 +32,7 @@ echo "Done";
|
||||||
*** Testing unserialize() error/boolean distinction ***
|
*** Testing unserialize() error/boolean distinction ***
|
||||||
string(4) "b:0;"
|
string(4) "b:0;"
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 0 of 27 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 0 of 27 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
bool(false)
|
bool(false)
|
||||||
unserialize error and deserialized false are identical? 1
|
unserialize error and deserialized false are identical? 1
|
||||||
|
|
|
@ -12,5 +12,5 @@ $s = serialize(new Test);
|
||||||
var_dump(str_replace("\0", '\0', $s));
|
var_dump(str_replace("\0", '\0', $s));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: serialize(): "priv" is returned from __sleep() multiple times in %s on line %d
|
Warning: serialize(): "priv" is returned from __sleep() multiple times in %s on line %d
|
||||||
string(37) "O:4:"Test":1:{s:10:"\0Test\0priv";N;}"
|
string(37) "O:4:"Test":1:{s:10:"\0Test\0priv";N;}"
|
||||||
|
|
|
@ -25,5 +25,5 @@ var_dump(unserialize($s));
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Cannot assign stdClass to property Test::$prop of type int
|
Cannot assign stdClass to property Test::$prop of type int
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 38 of 38 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 38 of 38 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -10,16 +10,16 @@ var_dump(unserialize("C:1:\"X\":1000000000:{}"));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 14 of 15 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 14 of 15 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 2 of 20 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 2 of 20 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 18 of 21 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 18 of 21 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
||||||
Warning: Insufficient data for unserializing - 1000000000 required, 1 present in %s on line %d
|
Warning: Insufficient data for unserializing - 1000000000 required, 1 present in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 20 of 21 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 20 of 21 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -12,5 +12,5 @@ try {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d
|
Warning: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d
|
||||||
Error at offset 24 of 113 bytes
|
Error at offset 24 of 113 bytes
|
||||||
|
|
|
@ -15,5 +15,5 @@ foo(unserialize($str));
|
||||||
echo "okey";
|
echo "okey";
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset %d of %d bytes in %sunserialize_mem_leak.php on line 9
|
Warning: unserialize(): Error at offset 13 of 14 bytes in %s on line %d
|
||||||
okey
|
okey
|
||||||
|
|
|
@ -8,5 +8,5 @@ STR;
|
||||||
var_dump(unserialize($str));
|
var_dump(unserialize($str));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 36 of 52 bytes in %s on line %d
|
Warning: unserialize(): Error at offset 36 of 52 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -6,5 +6,5 @@ $serialized_payload = 'a:3:{i:0;r:1;i:1;r:1;i:2;C:11:"ArrayObject":19:{x:i:0;r:1
|
||||||
var_dump(unserialize($serialized_payload));
|
var_dump(unserialize($serialized_payload));
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset %d of %d bytes in %sbug72433.php on line 3
|
Warning: unserialize(): Error at offset 13 of 69 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
|
@ -21,10 +21,10 @@ DONE
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Deprecated: %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
|
Deprecated: %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
|
||||||
|
|
||||||
Notice: unserialize(): Unexpected end of serialized data in %sbug72663.php on line %d
|
Warning: unserialize(): Unexpected end of serialized data in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 49 of 50 bytes in %sbug72663.php on line %d
|
Warning: unserialize(): Error at offset 49 of 50 bytes in %s on line %d
|
||||||
|
|
||||||
Notice: unserialize(): Error at offset 82 of 83 bytes in %sbug72663.php on line %d
|
Warning: unserialize(): Error at offset 82 of 83 bytes in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
DONE
|
DONE
|
||||||
|
|
|
@ -13,7 +13,7 @@ var_dump($_SESSION);
|
||||||
?>
|
?>
|
||||||
DONE
|
DONE
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: session_decode(): Unexpected end of serialized data in %sbug72663_2.php on line %d
|
Warning: session_decode(): Unexpected end of serialized data in %s on line %d
|
||||||
|
|
||||||
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s on line %d
|
||||||
array(0) {
|
array(0) {
|
||||||
|
|
|
@ -14,5 +14,5 @@ unserialize($poc);
|
||||||
?>
|
?>
|
||||||
DONE
|
DONE
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Notice: unserialize(): Error at offset 50 of 50 bytes in %sbug72663_3.php on line %d
|
Warning: unserialize(): Error at offset 50 of 50 bytes in %s on line %d
|
||||||
DONE
|
DONE
|
||||||
|
|
|
@ -842,7 +842,7 @@ static int php_var_serialize_try_add_sleep_prop(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zend_hash_add(ht, name, val)) {
|
if (!zend_hash_add(ht, name, val)) {
|
||||||
php_error_docref(NULL, E_NOTICE,
|
php_error_docref(NULL, E_WARNING,
|
||||||
"\"%s\" is returned from __sleep() multiple times", ZSTR_VAL(error_name));
|
"\"%s\" is returned from __sleep() multiple times", ZSTR_VAL(error_name));
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1399,7 +1399,7 @@ PHPAPI void php_unserialize_with_options(zval *return_value, const char *buf, co
|
||||||
}
|
}
|
||||||
if (!php_var_unserialize(retval, &p, p + buf_len, &var_hash)) {
|
if (!php_var_unserialize(retval, &p, p + buf_len, &var_hash)) {
|
||||||
if (!EG(exception)) {
|
if (!EG(exception)) {
|
||||||
php_error_docref(NULL, E_NOTICE, "Error at offset " ZEND_LONG_FMT " of %zd bytes",
|
php_error_docref(NULL, E_WARNING, "Error at offset " ZEND_LONG_FMT " of %zd bytes",
|
||||||
(zend_long)((char*)p - buf), buf_len);
|
(zend_long)((char*)p - buf), buf_len);
|
||||||
}
|
}
|
||||||
if (BG(unserialize).level <= 1) {
|
if (BG(unserialize).level <= 1) {
|
||||||
|
|
|
@ -1402,7 +1402,7 @@ fail:
|
||||||
|
|
||||||
"}" {
|
"}" {
|
||||||
/* this is the case where we have less data than planned */
|
/* this is the case where we have less data than planned */
|
||||||
php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data");
|
php_error_docref(NULL, E_WARNING, "Unexpected end of serialized data");
|
||||||
return 0; /* not sure if it should be 0 or 1 here? */
|
return 0; /* not sure if it should be 0 or 1 here? */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue