Bug 1053511

Summary: gzip -l & integer overflow
Product: [Fedora] Fedora Reporter: Need Real Name <mal>
Component: gzipAssignee: Michal Luscon <mluscon>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mluscon, pertusus, pstodulk
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-17 11:32:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2014-01-15 10:50:41 UTC
gzip -l shows incorrect data for large files (integer overflow)
for example 
# ll  backup.gz 
253542016 -rw-------. 1 root root 259626991897 Jan 14 02:12 backup.gz

# gzip  -l backup.gz 
         compressed        uncompressed  ratio uncompressed_name
       259626991897          2299183104 -11192.1% backup

see negative numbers in gzip -l
Same thing for gzip 1.4 & gzip 1.6

Comment 1 Petr Stodulka 2014-01-17 11:32:25 UTC
This problem is known. Same problem was reported here: 
https://bugzilla.redhat.com/show_bug.cgi?id=116967

Problem is the uncompressed file size is stored in 32b format. See man gzip section BUGS. If you want know real uncompressed size, you can use "zcat file.gz | wc -c" - unfortunately it's very slow solution for so large files.