Bug 318031 - uncompress() doesn't work
uncompress() doesn't work
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: zlib (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Ivana Varekova
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-04 06:27 EDT by Bastien Nocera
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-10 03:00:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
test.c (2.42 KB, text/plain)
2007-10-04 06:27 EDT, Bastien Nocera
no flags Details

  None (edit)
Description Bastien Nocera 2007-10-04 06:27:58 EDT
zlib-1.2.3-14.fc8

Attached is a test program for zlib's uncompress(). It returns -3 (Z_DATA_ERROR)
for every file I created.

1. Copy a test file locally, make a note of the uncompressed size
2. Compress it with gzip
3. Run ./test on the compressed file, verify that the uncompressed length
matches the one in 1, and wonder why it can't uncompress the data
Comment 1 Bastien Nocera 2007-10-04 06:27:58 EDT
Created attachment 215651 [details]
test.c
Comment 2 Bastien Nocera 2007-10-08 07:34:34 EDT
Ivana tells me that uncompress() only works when passed the data, and no
trailing data, or headers data.

But the documentation says:
"This function can be used to decompress a whole file at once if the input file
is mmap'ed."

The documentation should be fixed:
"This function can be used to decompress a whole file at once if the input file
is mmap'ed, and headers and trailing data are stripped from the input."

Note You need to log in before you can comment on or make changes to this bug.