Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Feb 2002 07:41:41 -0800 (PST)
From:      Stefan Farfeleder <e0026813@stud3.tuwien.ac.at>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/34698: bug in truss/main.c
Message-ID:  <200202071541.g17Ffft29964@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202071541.g17Ffft29964>