#42196 [Opn->Fbk]: unserialize artichecture problem

From: Date: Sat, 04 Aug 2007 14:08:04 +0000
Subject: #42196 [Opn->Fbk]: unserialize artichecture problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115748@lists.php.net to get a copy of this message
ID: 42196 Updated by: jani@php.net Reported By: joungkyun at gmail dot com -Status: Open +Status: Feedback Bug Type: Output Control Operating System: Linux PHP Version: 5CVS-2007-08-03 (CVS) New Comment: First of all, exactly why do you pass data like this between machines? Secondly: OF course you can't pass huge integers to 32bit system. So this is expected behaviour. What do you suggest happens in this case? Try this on 32bit system: echo (int) 4294967297; Previous Comments: ------------------------------------------------------------------------ [2007-08-03 09:51:46] joungkyun at gmail dot com Description: ------------ There is serialized data that made with 64bit integer on 64 bit system. On 32bit machine, if unserialize this data, you have result of integer overflow. Reproduce code: --------------- On, 64bit system echo serialize (4294967296 + 1); => result : "i:4294967297;" On, 32bit system echo unserilaize ("i:4294967297;"); => result : 1 Expected result: ---------------- On, 32bit system echo unserilaize ("i:4294967297;"); => result : 4294967297 Actual result: -------------- On, 32bit system echo unserilaize ("i:4294967297;"); => result : 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42196&edit=1

« previous php.bugs (#115748) next »