From owner-svn-src-all@FreeBSD.ORG Wed Sep 5 02:26:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C53531065675; Wed, 5 Sep 2012 02:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B05678FC12; Wed, 5 Sep 2012 02:26:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q852QDQK057454; Wed, 5 Sep 2012 02:26:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q852QDd4057452; Wed, 5 Sep 2012 02:26:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201209050226.q852QDd4057452@svn.freebsd.org> From: Ed Maste Date: Wed, 5 Sep 2012 02:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240124 - stable/8/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 02:26:13 -0000 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++;