Edit report at https://bugs.php.net/bug.php?id=65376&edit=1

 ID:                 65376
 Updated by:         m...@php.net
 Reported by:        carlosV2 dot 0 at gmail dot com
 Summary:            Unserialize function issue
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 Operating System:   Mac OS X
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.


Previous Comments:
------------------------------------------------------------------------
[2013-08-02 08:27:35] carlosV2 dot 0 at gmail dot com

Description:
------------
I think the unserialize method should have a final string length check.

You can make objects disappear just running the code in the Test Script:

This code outputs just the first object.
This is something it can easily happend when you are working with sockets or 
data 
streams.

Probably it is the developer's fault but actually to serialized objects 
together 
are not only one object.

I think checking the string length at the end of the parser and rising a 
warning 
is enough to alert the developer that this things are happening.

Test script:
---------------
$o1 = new stdClass();
$o1->name = 'Object1';

$o2 = new stdClass();
$o2->name = 'Object2';

$objects = serialize($o1) . serialize($o2);
print_r(unserialize($objects));

Expected result:
----------------
A warning

Actual result:
--------------
Only the first object:

stdClass Object
(
    [name] => Object1
)


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65376&edit=1

Reply via email to