Bug 318031 - uncompress() doesn't work
Summary: uncompress() doesn't work
Alias: None
Product: Fedora
Classification: Fedora
Component: zlib
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2007-10-04 10:27 UTC by Bastien Nocera
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-10-10 07:00:22 UTC
Type: ---

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

Description Bastien Nocera 2007-10-04 10:27:58 UTC

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]

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."

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