php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61287 A particular string fails to decompress
Submitted: 2012-03-05 14:14 UTC Modified: 2012-03-08 08:19 UTC
From: yoozer at gmail dot com Assigned: mike
Status: Closed Package: Zlib related
PHP Version: 5.4.0 OS: *
Private report: No CVE-ID:
 [2012-03-05 14:14 UTC] yoozer at gmail dot com
Description:
------------
We use gzdeflate to compress search parameters. When we recently upgraded from 5.3.8 to 5.4, a slew of error messages appeared. See the test script below. We've tried to minimize it, but any changes do not cause the error to trigger.

Changing the variable name "region_id" to "egion_id" results in 90.
Changing the variable name "region_id" to "tegion_id" causes the same error.
Changing the variable name "discipline" to "isciplined" results in 92.

Changing the value assigned to region_id from 1 to 2 results in 92.
Changing the value assigned to region_id from 1 to 4 results in an error.

Test script:
---------------
$array = array(
	'region_id' => 1,
	'discipline' => 23,
	'degrees' => array(),
	'country_id' => 27
);

$serialized = serialize($array);

$deflated = gzdeflate($serialized, 9);
$inflated = gzinflate($deflated);

echo strlen($inflated);

Expected result:
----------------
Expected: 92

Actual result:
--------------
Warning: gzinflate(): data error in D:\Web\Projects\Bench\index.php on line 13
0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-05 14:49 UTC] mike@php.net
-Assigned To: +Assigned To: mike
 [2012-03-05 15:00 UTC] pajoye@php.net
Not win specific, confirmed on other OSes too.
 [2012-03-05 15:00 UTC] pajoye@php.net
-Operating System: Windows +Operating System: *
 [2012-03-05 15:35 UTC] mike@php.net
Automatic comment from SVN on behalf of mike
Revision: http://svn.php.net/viewvc/?view=revision&revision=323916
Log: fix bug #61287 (A particular string fails to decompress)
 [2012-03-05 15:38 UTC] mike@php.net
Automatic comment from SVN on behalf of mike
Revision: http://svn.php.net/viewvc/?view=revision&revision=323917
Log: MFH: Fixed bug #61287 (A particular string fails to decompress)
 [2012-03-05 15:40 UTC] mike@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-03-05 15:40 UTC] mike@php.net
-Status: Assigned +Status: Closed
 [2012-03-07 09:08 UTC] yoozer at gmail dot com
I've tested this script with snapshots 323771 and 323962, but the problem still turns up in both :(.
 [2012-03-07 09:08 UTC] yoozer at gmail dot com
-Status: Closed +Status: Assigned
 [2012-03-07 22:07 UTC] me at ktamura dot com
This has indeed been fixed (tested on OSX) with the snapshot at 323988
 [2012-03-08 08:00 UTC] mike@php.net
-Status: Assigned +Status: Feedback
 [2012-03-08 08:00 UTC] mike@php.net
@yoozer can you *really* reproduce that this still fails for you with a current 
snapshot?

It might be Windows-only problem then...
 [2012-03-08 08:19 UTC] yoozer at gmail dot com
-Status: Feedback +Status: Closed
 [2012-03-08 08:19 UTC] yoozer at gmail dot com
Mike: I've tested it again on the latest Windows snapshot - 324008 - and the error 
has disappeared. It's strange how it popped up in r323962 for Windows which 
should've contained the fix. 

Anyway - it looks like it works as intended now. Thanks for the quick response!
 [2012-04-18 09:45 UTC] laruence@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e63e6647ff84852046cb12f2111fe9bda7eff244
Log: fix bug #61287 (A particular string fails to decompress)
 [2012-07-24 23:36 UTC] rasmus@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e63e6647ff84852046cb12f2111fe9bda7eff244
Log: fix bug #61287 (A particular string fails to decompress)
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e63e6647ff84852046cb12f2111fe9bda7eff244
Log: fix bug #61287 (A particular string fails to decompress)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 23:01:58 2014 UTC