Bug 318031

Summary: uncompress() doesn't work
Product: [Fedora] Fedora Reporter: Bastien Nocera <bnocera>
Component: zlibAssignee: Ivana Varekova <varekova>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-10 07:00:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test.c none

Description Bastien Nocera 2007-10-04 10:27:58 UTC
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 10:27:58 UTC
Created attachment 215651 [details]
test.c

Comment 2 Bastien Nocera 2007-10-08 11:34:34 UTC
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."