Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.4.1

Bug #21239 Gzipped response body larger than 4 GiB fails size check
Submitted: 2017-08-28 08:47 UTC
From: chris_ortner Assigned: avb
Status: Closed Package: HTTP_Request2 (version 2.3.0)
PHP Version: Irrelevant OS: Ubuntu 16.04
Roadmaps: (Not assigned)    
Subscription  


 [2017-08-28 08:47 UTC] chris_ortner (Chris Ortner)
Description: ------------ GZIP metadata contains the uncompressed size of the payload in bytes modulo 2^32. At decompression, we compare the unpacked size with the value in GZIP's metadata. To support files larger than 4 GiB, the observed unpacked size must be restricted by modulo 2^32 as well. This issue can be reproduced with multiple versions of HTTP_Request2, including the latest, and happens regardless of which adapter is used. Attached is a patch to resolve this issue. Test script: --------------- // Requires a server with GZIP compression enabled hosting a file larger than 4 GiB: $url = 'https://example.org/large_file.txt'; $request = new HTTP_Request2(); $request->setUrl($url); $request->setMethod(HTTP_Request2::METHOD_GET); $response = $request->send(); // This fails. Expected result: ---------------- The contents of the large file are assigned to $response. Actual result: -------------- A HTTP_Request2_MessageException is thrown with message "Data size check failed".

Comments

 [2017-08-28 08:51 UTC] chris_ortner (Chris Ortner)
 [2020-07-05 19:22 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
Fixed in git: https://github.com/pear/HTTP_Request2/commit/526c0d1c52c3b132c3d8f001160a8f096ed535a2