Author: emaste
Date: Wed Aug 29 21:38:34 2012
New Revision: 239883
URL: http://svn.freebsd.org/changeset/base/239883

Log:
  Avoid passing uninitialized stack to addelem() if called with an empty arg.
  
  PR:           bin/171174

Modified:
  head/bin/ps/ps.c

Modified: head/bin/ps/ps.c
==============================================================================
--- head/bin/ps/ps.c    Wed Aug 29 21:12:19 2012        (r239882)
+++ head/bin/ps/ps.c    Wed Aug 29 21:38:34 2012        (r239883)
@@ -889,8 +889,8 @@ add_list(struct listinfo *inf, const cha
        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++;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to