NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/59526: file(1) reports "lhs/off overflow" for gz files



The following reply was made to PR bin/59526; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/59526: file(1) reports "lhs/off overflow" for gz files
Date: Sat, 12 Jul 2025 20:34:55 -0000 (UTC)

 jschauma%netmeister.org@localhost writes:
 
 >$ file /tmp/f.gz
 >lhs/off overflow 3080456200 0
 >/tmp/f.gz: gzip compressed data, was "f", last modified: Sat Jul 12 19:26:42 2025, max compression, from Unix, truncated
 
 % file /tmp/f.gz
 lhs/off overflow 3218540552 0
 /tmp/f.gz: gzip compressed data, was "f", last modified: Sat Jul 12 20:04:39 2025, from Unix, truncated
 
 00000000  1f 8b 08 08 d7 bf 72 68  00 03 66 00 4b cb cf e7  |......rh..f.K...|
 00000010  02 00 a8 65 32 7e 04 00  00 00                    |...e2~....|
 0000001a
 
 and  3218540552 = 0xbfd70808
 
 The number is slightly different as byte 4..7 are a 32bit UNIX time value.
 
 The error message comes from a pattern in the magic file that interprets
 byte 2..5 as a positive signed little-endian 32bit number. So if
 byte 5 >= 128, you see the warning from the parser.
 
 Pushing the date a few hours (then byte 5 is < 128) yields:
 
 % sudo date 07130240
 Sun Jul 13 02:40:00 CEST 2025
 gossam% echo foo > /tmp/f
 gossam% gzip /tmp/f
 /tmp/f.gz already exists -- do you wish to overwrite (y or n)? y
 gossam% file /tmp/f.gz
 /tmp/f.gz: gzip compressed data, was "f", last modified: Sun Jul 13 00:40:08 2025, from Unix, truncated
 
 
 The version of file(1) in NetBSD-current has fixed this and additionally
 will print the warning only in debug mode.
 


Home | Main Index | Thread Index | Old Index