From owner-freebsd-bugs Thu Feb 7 7:50:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 62E3437B421 for ; Thu, 7 Feb 2002 07:50:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g17Fo1X37508; Thu, 7 Feb 2002 07:50:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5D8BF37B416 for ; Thu, 7 Feb 2002 07:41:41 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g17Ffft29964; Thu, 7 Feb 2002 07:41:41 -0800 (PST) (envelope-from nobody) Message-Id: <200202071541.g17Ffft29964@freefall.freebsd.org> Date: Thu, 7 Feb 2002 07:41:41 -0800 (PST) From: Stefan Farfeleder To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/34698: bug in truss/main.c Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34698 >Category: bin >Synopsis: bug in truss/main.c >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 07 07:50:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: 4-5 >Organization: >Environment: FreeBSD stefan.fafoe 4.5-RELEASE FreeBSD 4.5-RELEASE #1: Sat Feb 2 13:05:42 CET 2002 stefan@stefan.fafoe:/usr/obj/usr/src/sys/MYKERNEL i386 >Description: In the function set_etype() the variable funcs loops over the known binary types. If no match is found, funcs->type gets NULL and the loop terminates. Next funcs itself is incorrectly compared to NULL instead of funcs->type. Thus NULL is returned from set_etype() and when the result is later dereferenced truss will dump core. >How-To-Repeat: Run truss with a binary unknown to truss; known are 'FreeBSD a.out', 'FreeBSD ELF' and 'Linux ELF' on i386 at the moment. >Fix: Note: patch is against 1.15.2.1 as I have no -current tree around. --- main.c.orig Thu Feb 7 16:30:36 2002 +++ main.c Thu Feb 7 16:30:53 2002 @@ -132,7 +132,7 @@ if (!strcmp(funcs->type, progtype)) break; - if (funcs == NULL) { + if (funcs->type == NULL) { warn("Execution type %s is not supported -- using FreeBSD a.out\n", progtype); funcs = &ex_types[0]; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message