summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2006-04-05 17:40:46 +0000
committergad <gad@FreeBSD.org>2006-04-05 17:40:46 +0000
commit8cc35ce532b0698c004769fffefc3abb2d5f5204 (patch)
tree049ab626033cbb866ccd1665f68993f2149e96d0 /bin/ps
parent435490fd44444f7e638eb8a518e43c30b5e06762 (diff)
downloadFreeBSD-src-8cc35ce532b0698c004769fffefc3abb2d5f5204.zip
FreeBSD-src-8cc35ce532b0698c004769fffefc3abb2d5f5204.tar.gz
Fix a problem introduced by change 1.73, which causes a seg-fault if
the user specifies a keyword which is an alias to some other keyword. E.g.: stat (for state) or pcpu (for %cpu).. Submitted by: Kostik Belousov MFC plans: "soon"
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/keyword.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 9ae82c3..0c0f4c5 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -302,6 +302,8 @@ findvar(char *p, int user, char **header)
hp = strchr(p, '=');
if (hp)
*hp++ = '\0';
+ else
+ hp = p;
key.name = p;
v = bsearch(&key, var, sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp);
OpenPOWER on IntegriCloud