Subject: bin/10096: /bin/ps segmentation fault
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yyamano@kt.rim.or.jp>
List: netbsd-bugs
Date: 05/10/2000 21:51:15
>Number:         10096
>Category:       bin
>Synopsis:       /bin/ps segmentation fault
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 10 21:52:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Yuji Yamano
>Release:        NetBSD 1.4.1
>Organization:
>Environment:
System: NetBSD casper 1.4.1 NetBSD 1.4.1 (CASPER.v6) #1: Wed Jan 26 19:31:49 JST 2000 yyamano@casper:/usr/home/yyamano/src/KAME/kame/netbsd/sys/arch/i386/compile/CASPER.v6 i386

>Description:

When run `ps -O,', it says "Segmentation fault".

>How-To-Repeat:
% /bin/ps -O,
Segmentation fault

>Fix:

--- keyword.c.orig	Wed Feb 18 06:37:56 1998
+++ /usr/src/bin/ps/keyword.c	Thu May 11 13:06:13 2000
@@ -216,7 +216,7 @@
 
 		while ((cp = strsep(&p, FMTSEP)) != NULL && *cp == '\0')
 			/* void */;
-		if (!(v = findvar(cp)))
+		if (cp == NULL || !(v = findvar(cp)))
 			continue;
 		if ((vent = malloc(sizeof(struct varent))) == NULL)
 			err(1, "%s", "");
>Release-Note:
>Audit-Trail:
>Unformatted: