NetBSD Problem Report #57525

From www@netbsd.org  Thu Jul 13 14:22:54 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D2F441A923D
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 13 Jul 2023 14:22:54 +0000 (UTC)
Message-Id: <20230713142253.4E7351A923E@mollari.NetBSD.org>
Date: Thu, 13 Jul 2023 14:22:53 +0000 (UTC)
From: roland.illig@gmx.de
Reply-To: roland.illig@gmx.de
To: gnats-bugs@NetBSD.org
Subject: file: lhs/off overflow on gzipped file
X-Send-Pr-Version: www-1.0

>Number:         57525
>Category:       bin
>Synopsis:       file: lhs/off overflow on gzipped file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 13 14:25:00 +0000 2023
>Last-Modified:  Thu Jul 13 15:55:01 +0000 2023
>Originator:     Roland Illig
>Release:        10.99.3
>Organization:
>Environment:
NetBSD nbcurr.roland-illig.de 10.99.3 NetBSD 10.99.3 (GENERIC) #0: Fri Apr 21 02:17:32 UTC 2023  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:

>How-To-Repeat:
$ touch -t 202307131323 f
$ gzip -c f | file -
lhs/off overflow 4206102536 0
/dev/stdin: gzip compressed data, was "f", last modified: Thu Jul 13 13:23:00 2023, from Unix

>Fix:

>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/57525: file: lhs/off overflow on gzipped file
Date: Thu, 13 Jul 2023 15:51:28 -0000 (UTC)

 roland.illig@gmx.de writes:

 >$ touch -t 202307131323 f
 >$ gzip -c f | file -
 >lhs/off overflow 4206102536 0
 >/dev/stdin: gzip compressed data, was "f", last modified: Thu Jul 13 13:23:00 2023, from Unix


 That error message should better be left for debugging.

 file(1) checks for:

 (0x02.l)        string  *IDENTIFICATION         Becker & Hickl PMS Data File

 the little-endian signed 32bit value at offset 2 is interpreted as an
 offset into the file where the string "*IDENTIFICATION" acts as a magic
 number.

 The error message is about the parsed offset being out of range for a
 signed value (the value is printed then as unsigned). The message is
 fine, if the offset were used to fetch additional data from a file,
 but not useful, when identifying the file format.

 N.B. I have no idea why the file format defines the offset to be
 interpreted as a signed value. But that's not the problem of file(1).

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.