|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47179 gzuncompress does not report expcted error
Submitted: 2009-01-21 11:11 UTC Modified: 2009-12-09 20:34 UTC
From: wharmby at uk dot ibm dot com Assigned:
Status: Closed Package: Zlib related
PHP Version: 6CVS-2009-01-21 (snap) OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: wharmby at uk dot ibm dot com
New email:
PHP Version: OS:


 [2009-01-21 11:11 UTC] wharmby at uk dot ibm dot com
gzuncompress() does not report error if $limit > 0 but too short for data being uncompressed. 

Problem is PHP specific; test OK on latest php 5.2 and 5.3 snaps.

I will be dropping new PHPT shortly for gzuncompress(); the PHP 6 tests will be tagged with a XFAIL because of this defect. 


Reproduce code:
$data = b'string_val';
$compressed = gzcompress($data);
var_dump(gzuncompress($compressed, strlen($data)));
var_dump(gzuncompress($compressed, 1));

Expected result:
Expected output (based on output for same script when run on 5.2/5.3)

string(10) "string_val"

Warning: gzuncompress(): buffer error in <...> on line 5

Actual result:
string(10) "string_val"
string(10) "string_val"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-21 12:38 UTC] wharmby at uk dot ibm dot com
New test dropped into php 5.2, 5.3 and 6: 


PHP 6 test tagged with XFAIL referencing this defect
 [2009-12-09 20:33 UTC]
Automatic comment from SVN on behalf of jani
Log: - Fixed bug #47179 (gzuncompress does not report expcted error)
 [2009-12-09 20:34 UTC]
You get error now, not the same as in 5.x since they have totally different code around there, but better: insufficient memory. :)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 15:01:28 2024 UTC