Bug #77302 [NEW]: Unserialize decode issue

From: Date: Sat, 15 Dec 2018 08:50:43 +0000
Subject: Bug #77302 [NEW]: Unserialize decode issue
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218461@lists.php.net to get a copy of this message
From:             sh at analogic dot cz
Operating system: 
PHP version:      7.3.0
Package:          *General Issues
Bug Type:         Bug
Bug description:Unserialize decode issue

Description:
------------
See test script
5.6.38 - 7.2.13 will work OK
7.3.0 fails with "Notice: unserialize(): Error at offset 938 of 2517
bytes in /in/gTumn on line 3"
(https://3v4l.org/gTumn)

Object is serialized at PHP 7.3.0

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

var_dump(unserialize('a:4:{i:0;O:20:"AppBundle\\Entity\\Box":18:{s:10:"'
. "\0" . '*' . "\0" .
'address";s:13:"test@test.com";s:7:"' . "\0" . '*'
. "\0" . 'user";s:4:"test";s:9:"' . "\0" .
'*' . "\0" .
'domain";O:38:"Proxies\\__CG__\\AppBundle\\Entity\\Domain":10:{s:17:"__isInitialized__";b:1;s:7:"'
. "\0" . '*' . "\0" .
'name";s:8:"test.com";s:10:"' . "\0" . '*' .
"\0"
. 'created";O:8:"DateTime":3:{s:4:"date";s:26:"2018-12-14
21:38:14.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}s:10:"'
. "\0" . '*' . "\0" .
'updated";O:8:"DateTime":3:{s:4:"date";s:26:"2018-12-14
21:38:14.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}s:12:"'
. "\0" . '*' . "\0" . 'domainBin";b:0;s:19:"' .
"\0" . '*' . "\0" .
'domainBinAddress";N;s:10:"' . "\0" . '*' . "\0" .
'forward";b:0;s:16:"'
. "\0" . '*' . "\0" . 'forwardDomain";N;s:14:"' .
"\0" . '*' . "\0" .
'referenceId";N;s:8:"' . "\0" . '*' . "\0" .
'boxes";O:33:"Doctrine\\ORM\\PersistentCollection":2:{s:13:"' .
"\0" .
'*' . "\0" .
'collection";O:43:"Doctrine\\Common\\Collections\\ArrayCollection":1:{s:53:"'
. "\0" . 'Doctrine\\Common\\Collections\\ArrayCollection' . "\0" .
'elements";a:1:{i:0;O:20:"AppBundle\\Entity\\Box":18:{s:10:"' .
"\0" .
'*' . "\0" . 'address";s:13:"test@test.com";s:7:"'
. "\0" . '*' . "\0" .
'user";s:4:"test";s:9:"' . "\0" . '*' .
"\0" . 'domain";r:6;s:11:"' .
"\0" . '*' . "\0" .
'password";s:120:"{SHA512-CRYPT}$6$acvyLX2N9lsg1F.K$Bop/wS7UxWIH/VzR0uGhopOBSVvwlAdsdxzqXgwluo4VmylnzgGQ5/UhdHZ/1U0UyID8POk2/vGy2h4Q4pGSQ1";s:20:"'
. "\0" . '*' . "\0" .
'passwordPlaintext";s:0:"";s:7:"' . "\0" . '*' .
"\0" . 'home";s:27:"/data/domains/test.com/test";s:6:"' .
"\0" . '*' .
"\0" . 'uid";i:8;s:6:"' . "\0" . '*' .
"\0" . 'gid";i:8;s:7:"' . "\0" .
'*' . "\0" . 'name";s:0:"";s:11:"' .
"\0" . '*' . "\0" .
'disabled";b:0;s:14:"' . "\0" . '*' . "\0" .
'domainAdmin";b:0;s:13:"' .
"\0" . '*' . "\0" . 'superAdmin";b:1;s:21:"' .
"\0" . '*' . "\0" .
'strictFromDisabled";b:0;s:14:"' . "\0" . '*' .
"\0" .
'referenceId";N;s:10:"' . "\0" . '*' . "\0" .
'created";O:8:"DateTime":3:{s:4:"date";s:26:"2018-12-14
21:38:33.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}s:10:"'
. "\0" . '*' . "\0" .
'updated";O:8:"DateTime":3:{s:4:"date";s:26:"2018-12-14
21:39:41.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}s:15:"'
. "\0" . '*' . "\0" . 'redirectOnly";b:0;s:13:"' .
"\0" . '*' . "\0" .
'redirectTo";a:0:{}}}}s:14:"' . "\0" . '*' . "\0"
.
'initialized";b:1;}}s:11:"' . "\0" . '*' . "\0" .
'password";s:120:"{SHA512-CRYPT}$6$acvyLX2N9lsg1F.K$Bop/wS7UxWIH/VzR0uGhopOBSVvwlAdsdxzqXgwluo4VmylnzgGQ5/UhdHZ/1U0UyID8POk2/vGy2h4Q4pGSQ1";s:20:"'
. "\0" . '*' . "\0" .
'passwordPlaintext";s:0:"";s:7:"' . "\0" . '*' .
"\0" . 'home";s:27:"/data/domains/test.com/test";s:6:"' .
"\0" . '*' .
"\0" . 'uid";i:8;s:6:"' . "\0" . '*' .
"\0" . 'gid";i:8;s:7:"' . "\0" .
'*' . "\0" . 'name";s:0:"";s:11:"' .
"\0" . '*' . "\0" .
'disabled";b:0;s:14:"' . "\0" . '*' . "\0" .
'domainAdmin";b:0;s:13:"' .
"\0" . '*' . "\0" . 'superAdmin";b:1;s:21:"' .
"\0" . '*' . "\0" .
'strictFromDisabled";b:0;s:14:"' . "\0" . '*' .
"\0" .
'referenceId";N;s:10:"' . "\0" . '*' . "\0" .
'created";r:40;s:10:"' .
"\0" . '*' . "\0" . 'updated";r:44;s:15:"' .
"\0" . '*' . "\0" .
'redirectOnly";b:0;s:13:"' . "\0" . '*' . "\0" .
'redirectTo";a:0:{}}i:1;b:1;i:2;a:2:{i:0;O:41:"Symfony\\Component\\Security\\Core\\Role\\Role":1:{s:47:"'
. "\0" . 'Symfony\\Component\\Security\\Core\\Role\\Role' . "\0" .
'role";s:9:"ROLE_USER";}i:1;O:41:"Symfony\\Component\\Security\\Core\\Role\\Role":1:{s:47:"'
. "\0" . 'Symfony\\Component\\Security\\Core\\Role\\Role' . "\0" .
'role";s:16:"ROLE_SUPER_ADMIN";}}i:3;a:0:{}}'));

Expected result:
----------------
Object is decoded and dumped

Actual result:
--------------
Notice: unserialize(): Error at offset 938 of 2517 bytes in /in/gTumn on
line 3

-- 
Edit bug report at https://bugs.php.net/bug.php?id=77302&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77302&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77302&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77302&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77302&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77302&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77302&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77302&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77302&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77302&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77302&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77302&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77302&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77302&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77302&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77302&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77302&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77302&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77302&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77302&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77302&r=mysqlcfg



Thread (15 messages)

« previous php.bugs (#218461) next »