summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2012-08-29 21:38:34 +0000
committeremaste <emaste@FreeBSD.org>2012-08-29 21:38:34 +0000
commit87db19685be32a4c0e475885aadad34d411ca074 (patch)
treebb4f45bfa858f72fbd5ec61411c97b95ce00ba63 /bin/ps
parent8c4a818b3d5ae3cb15360246b09b689e253ed8e4 (diff)
downloadFreeBSD-src-87db19685be32a4c0e475885aadad34d411ca074.zip
FreeBSD-src-87db19685be32a4c0e475885aadad34d411ca074.tar.gz
Avoid passing uninitialized stack to addelem() if called with an empty arg.
PR: bin/171174
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/ps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index f507b6a..ebabc19 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -889,8 +889,8 @@ add_list(struct listinfo *inf, const char *argp)
int toolong;
char elemcopy[PATH_MAX];
- if (*argp == 0)
- inf->addelem(inf, elemcopy);
+ if (*argp == '\0')
+ inf->addelem(inf, argp);
while (*argp != '\0') {
while (*argp != '\0' && strchr(W_SEP, *argp) != NULL)
argp++;
OpenPOWER on IntegriCloud