Received: by smtp02.oce.nl (4.1/SMI-4.1)
	id AA25911; Tue, 24 Nov 98 09:25:26 +0100
Received: from sgi.sgi.com (SGI.COM [192.48.153.1])
	by oce.nl (8.9.0/8.9.0) with ESMTP id JAA22007
	for <rvdt@oce.nl>; Tue, 24 Nov 1998 09:17:26 +0100 (MET)
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) 
	by sgi.sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via ESMTP id AAA05881; Tue, 24 Nov 1998 00:11:31 -0800 (PST)
	mail_from (owner-tiff@sgi.engr.sgi.com)
Received: (from majordomo-owner@localhost)
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	id XAA56716
	for tiff-list;
	Mon, 23 Nov 1998 23:12:12 -0800 (PST)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37])
	by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF)
	via ESMTP id XAA27372
	for <tiff-relay@engr.sgi.com>;
	Mon, 23 Nov 1998 23:12:10 -0800 (PST)
	mail_from (owner-tiff@sgi.sgi.com)
Received: from dms.corena.no (dms.corena.no [193.69.46.253]) 
	by sgi.sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via SMTP id XAA06842
	for <tiff@sgi.com>; Mon, 23 Nov 1998 23:12:07 -0800 (PST)
	mail_from (brox@corena.no)
Received: from senja.corena.no by dms.corena.no (AIX 3.2/UCB 5.64/4.03)
          id AA28256; Tue, 24 Nov 1998 08:14:37 +0100
Received: by senja.corena.no (AIX 3.2/UCB 5.64/4.03)
          id AA13459; Tue, 24 Nov 1998 08:14:36 +0100
From: brox@corena.no (Bjorn Brox)
Message-Id: <9811240714.AA13459@senja.corena.no>
Subject: Re: Bug in tif_unix.c
To: tiff@sgi.com (TIFF Mailing List)
Date: Tue, 24 Nov 1998 08:14:35 +0100 (CET)
In-Reply-To: <365216B2.2A27C00F@cp10.es.xerox.com> from "Terry Wells" at Nov 17, 98 04:37:06 pm
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Sender: owner-tiff@fddi-sgi.sgi.com
Precedence: bulk

Terry Wells wrote this:
> 
> Hi all,
> 
> I just noticed a bug in tif_unix.c (and perhaps tif_win32.c, but I'm not
> sure)
> 
> Catch is, I don't know if it's worth fixing or not...
> 
> 
> The Problem:
> ------------
> In the function _tiffMapProc, the function _tiffSizeProc is used to get
> the size of the file.  This size is then compared with -1 to check for
> an error.
> 
> The problem is that _tiffSizeProc always returns a value >= 0.  Thus
> size will never be -1 and _tiffMapProc will always attempt to map the
> file.

Yes, this is an error present in tif_unix.c, tif_msdos.c, tif_vms.c and
tif_win3.c

The _tiffSizeProc() function should return -1 when the file id is attached
to a terminal or similar. In such cases _tiffMapProc() would also fail so
not fixing the error would not cause any fatal errors.

Fixing it?
Sam?

-- 
Bjorn Brox, CORENA Norge AS, http://www.corena.no/
Kirkegaardsvn. 45, P.O.Box 1024, N-3601 Kongsberg, NORWAY
Phone: +47 32737435, Fax: +47 32736877, Mobile: +47 92638590
