Subject: pkg/19306: (with fix) fax2tiff crashes
To: None <gnats-bugs@gnats.netbsd.org>
From: Ingolf Steinbach <ingolf-fax2tiff@steinba.ch>
List: netbsd-bugs
Date: 12/07/2002 01:02:20
>Number:         19306
>Category:       pkg
>Synopsis:       fax2tiff (from graphics/tiff) crashes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 06 16:03:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ingolf Steinbach
>Release:        NetBSD 1.6
>Organization:
none
>Environment:
System: NetBSD helios 1.6 NetBSD 1.6 (GENERIC) #3: Fri Nov 1 02:27:02 CET 2002 ingolf@helios:/usr/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
current graphics/tiff package
>Description:
	The fax2tiff program from the graphics/tiff package crashes.
This is due to a 0-pointer dereference which can be avoided by including
the patch below.
>How-To-Repeat:
	Just run the program without any parameters.
>Fix:
	Add the following patch to the patches directory:
$NetBSD$

--- tools/fax2tiff.c.orig	Fri Jan 28 22:18:16 2000
+++ tools/fax2tiff.c
@@ -69,6 +69,13 @@ DummyWriteProc(thandle_t fd, tdata_t buf
 	return (size);
 }
 
+static toff_t
+DummySeekProc(thandle_t fd, toff_t offset, int whence)
+{
+	(void) fd; (void) offset; (void) whence;
+	return (0);
+}
+
 int
 main(int argc, char* argv[])
 {
@@ -89,7 +96,7 @@ main(int argc, char* argv[])
 	/* smuggle a descriptor out of the library */
 	faxTIFF = TIFFClientOpen("(FakeInput)", "w", (thandle_t) -1,
 				 DummyReadProc, DummyWriteProc,
-				 NULL, NULL, NULL, NULL, NULL);
+				 DummySeekProc, NULL, NULL, NULL, NULL);
 	if (faxTIFF == NULL)
 		return (EXIT_FAILURE);
 	faxTIFF->tif_mode = O_RDONLY;
>Release-Note:
>Audit-Trail:
>Unformatted: