ID: 31442
Updated by: helly@php.net
Reported By: michal at cihar dot com
-Status: Open
+Status: Feedback
Bug Type: Zend Engine 2 problem
Operating System: 64-bit
PHP Version: 4.3.10, 5.0.3
Assigned To: helly
New Comment:
php run-tests.php ext/standard/tests/serialize
...
FAILED TEST SUMMARY
---------------------------------------------------------------------
serialize()/unserialize()/var_dump()
[ext/standard/tests/serialize/001.phpt]
Bug #25378 (unserialize() crashes with invalid data)
[ext/standard/tests/serialize/002.phpt]
Bug #14293 (serialize() and __sleep())
[ext/standard/tests/serialize/bug14293.phpt]
Bug #21957 (serialize() mangles objects with __sleep)
[ext/standard/tests/serialize/bug21957.phpt]
Bug #25378 (unserialize() crashes with invalid data)
[ext/standard/tests/serialize/bug25378.phpt]
Bug #28325 (Problem in serialisation of circular references)
[ext/standard/tests/serialize/bug28325.phpt]
Previous Comments:
------------------------------------------------------------------------
[2005-01-08 18:32:38] michal at cihar dot com
What kind of tests do fail? I have no idea what could be broken by this
change.
------------------------------------------------------------------------
[2005-01-08 14:41:01] helly@php.net
If i apply that patch to a 32 bit machine i get many test errors any
idea? Also it is enough to put the .re diff
------------------------------------------------------------------------
[2005-01-07 16:53:10] michal at cihar dot com
I haven't found way to attach patches here, so it's available on my
web: http://www.cihar.com/misc/php-unserializer.patch
------------------------------------------------------------------------
[2005-01-07 16:48:11] michal at cihar dot com
Description:
------------
Unserializing of numbers > MAX_INT is wrong. That's because php uses
long internally for storing ints but int is used in unserializing.
Attached patch fixes this issue.
Reproduce code:
---------------
<?php
echo unserialize(serialize(2147483648));
?>
Expected result:
----------------
2147483648
Actual result:
--------------
-2147483648
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31442&edit=1