svn commit: r240124 - stable/8/bin/ps

Ed Maste emaste at FreeBSD.org
Wed Sep 5 02:26:13 UTC 2012


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++;


More information about the svn-src-all mailing list