svn commit: r239883 - head/bin/ps

Ed Maste emaste at FreeBSD.org
Wed Aug 29 21:38:35 UTC 2012


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


More information about the svn-src-head mailing list