php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70390 Invalid object size in serialized string
Submitted: 2015-08-29 16:29 UTC Modified: 2015-08-29 17:18 UTC
From: alec at alec dot pl Assigned: cmb (profile)
Status: Duplicate Package: Unknown/Other Function
PHP Version: 7.0.0RC1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alec at alec dot pl
New email:
PHP Version: OS:

 

 [2015-08-29 16:29 UTC] alec at alec dot pl
Description:
------------
Number of properties of serialized object is wrong after setting unknown property and unsetting an existing one. This causes that the object can't be unserialized. See test script.

Test script:
---------------
<?php

class test
{
    public $prop;
}

$test = new test;
$test->unknown = 'test';
unset($test->prop);

print_r(unserialize(serialize($test)));

Expected result:
----------------
test Object
(
    [unknown] => test
)


Actual result:
--------------
PHP Notice:  unserialize(): Unexpected end of serialized data in test.php on line 17
PHP Notice:  unserialize(): Error at offset 39 of 40 bytes in test.php on line 17


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-29 17:18 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-08-29 17:18 UTC] cmb@php.net
This is a duplicate of bug #70187, which has already been fixed in
latest master.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC