#31442 [Opn->Asn]: unserialize broken on 64-bit systems

From: Date: Sat, 08 Jan 2005 13:40:49 +0000
Subject: #31442 [Opn->Asn]: unserialize broken on 64-bit systems
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-71611@lists.php.net to get a copy of this message
 ID:               31442
 Updated by:       sniper@php.net
 Reported By:      michal at cihar dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Zend Engine 2 problem
 Operating System: 64-bit
 PHP Version:      4.3.10, 5.0.3
 Assigned To:      helly


Previous Comments:
------------------------------------------------------------------------

[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


Thread (11 messages)

« previous php.bugs (#71611) next »