From 42856668808f8772560f94d2473da4e62225acdd Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 29 Aug 2012 21:38:34 +0000 Subject: [PATCH] Avoid passing uninitialized stack to addelem() if called with an empty arg. PR: bin/171174 --- bin/ps/ps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index f507b6a028f3..ebabc1952fab 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++;