Author: emaste
Date: Wed Sep  5 02:26:13 2012
New Revision: 240124
URL: http://svn.freebsd.org/changeset/base/240124

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

Modified:
  stable/8/bin/ps/ps.c
Directory Properties:
  stable/8/bin/ps/   (props changed)

Modified: stable/8/bin/ps/ps.c
==============================================================================
--- stable/8/bin/ps/ps.c        Wed Sep  5 02:03:43 2012        (r240123)
+++ stable/8/bin/ps/ps.c        Wed Sep  5 02:26:13 2012        (r240124)
@@ -857,8 +857,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-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to