NetBSD-Bugs archive

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

Re: bin/57738 (file command getting overflow message)



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

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/57738 (file command getting overflow message)
Date: Sat, 6 Jan 2024 19:03:54 -0000 (UTC)

 christos%zoulas.com@localhost (Christos Zoulas) writes:
 
 >[11:35am] 2124>./file  -m ../magic/magic.mgc ~/Babel-2.13.1.tar.gz=20
 >/Users/christos/Babel-2.13.1.tar.gz: gzip compressed data, was =
 >"Babel-2.13.1.tar", last modified: Tue Oct 24 14:33:06 2023, max =
 >compression, original size modulo 2^32 3bel-2.13.1.tar.gz 
 
 % file Babel-2.13.1.tar.gz 
 lhs/off overflow 3584165896 0
 Babel-2.13.1.tar.gz: gzip compressed data, was "Babel-2.13.1.tar", last modified: Tue Oct 24 14:33:06 2023, max compression, original size modulo 2^32 34293760
 4293760
 
 You need a 32bit machine to see the message when file validates a number
 against INT_MIN/INT_MAX and here that gets triggered by the pattern:
 
 (0x02.l)        string  *IDENTIFICATION         Becker & Hickl PMS Data File
 
 The bytes at offset 0x02 in Babel-2.13.1.tar.gz are 08 08 a2 d5, the
 read value is therefore 0xd5a20808 and that overflows a signed integer.
 
 


Home | Main Index | Thread Index | Old Index