Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Sep 2012 02:26:13 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r240124 - stable/8/bin/ps
Message-ID:  <201209050226.q852QDd4057452@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209050226.q852QDd4057452>