From owner-svn-src-stable@FreeBSD.ORG Thu Apr 1 00:38:39 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E4701065670; Thu, 1 Apr 2010 00:38:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F02C38FC18; Thu, 1 Apr 2010 00:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o310cc78070704; Thu, 1 Apr 2010 00:38:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o310cc4O070702; Thu, 1 Apr 2010 00:38:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004010038.o310cc4O070702@svn.freebsd.org> From: Xin LI Date: Thu, 1 Apr 2010 00:38:38 +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: r206025 - in stable: 6/libexec/ftpd 7/libexec/ftpd 8/libexec/ftpd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Apr 2010 00:38:39 -0000 Author: delphij Date: Thu Apr 1 00:38:38 2010 New Revision: 206025 URL: http://svn.freebsd.org/changeset/base/206025 Log: MFC r205656: Check that gl_pathc is bigger than zero before derefencing gl_pathv. When gl_pathc == 0, the content of gl_pathv is undefined. PR: bin/144761 Submitted by: David BERARD Obtained from: OpenBSD Modified: stable/8/libexec/ftpd/popen.c Directory Properties: stable/8/libexec/ftpd/ (props changed) Changes in other areas also in this revision: Modified: stable/6/libexec/ftpd/popen.c stable/7/libexec/ftpd/popen.c Directory Properties: stable/6/libexec/ftpd/ (props changed) stable/7/libexec/ftpd/ (props changed) Modified: stable/8/libexec/ftpd/popen.c ============================================================================== --- stable/8/libexec/ftpd/popen.c Thu Apr 1 00:36:40 2010 (r206024) +++ stable/8/libexec/ftpd/popen.c Thu Apr 1 00:38:38 2010 (r206025) @@ -110,10 +110,11 @@ ftpd_popen(char *program, char *type) flags |= GLOB_LIMIT; if (glob(argv[argc], flags, NULL, &gl)) gargv[gargc++] = strdup(argv[argc]); - else + else if (gl.gl_pathc > 0) { for (pop = gl.gl_pathv; *pop && gargc < (MAXGLOBARGS-1); pop++) gargv[gargc++] = strdup(*pop); + } globfree(&gl); } gargv[gargc] = NULL;