summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-02-14 18:54:34 +0000
committerjlemon <jlemon@FreeBSD.org>2001-02-14 18:54:34 +0000
commit7947c37b14ab964be46d5b28be8954d0646540ca (patch)
tree4d6fa0e4622032b92da1b56d4c92b3d1de269d88 /bin/ps
parent75828ea30b5f762aea56327e516330b13714bb2c (diff)
downloadFreeBSD-src-7947c37b14ab964be46d5b28be8954d0646540ca.zip
FreeBSD-src-7947c37b14ab964be46d5b28be8954d0646540ca.tar.gz
Do not coredump if no options are supplied. (ps -o,)
Submitted by: rgrimes Obtained from: NetBSD
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/keyword.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 6a6b277..af33593 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -219,7 +219,7 @@ parsefmt(p)
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, NULL);
OpenPOWER on IntegriCloud