From owner-svn-src-all@freebsd.org Sun Mar 13 22:54:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D57AACF28F; Sun, 13 Mar 2016 22:54:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA22616; Sun, 13 Mar 2016 22:54:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2DMsE8W094233; Sun, 13 Mar 2016 22:54:14 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DMsETB094232; Sun, 13 Mar 2016 22:54:14 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201603132254.u2DMsETB094232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 13 Mar 2016 22:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296813 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 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: Sun, 13 Mar 2016 22:54:15 -0000 Author: jilles Date: Sun Mar 13 22:54:14 2016 New Revision: 296813 URL: https://svnweb.freebsd.org/changeset/base/296813 Log: sh: Fix copying uninitialized field 'special'. This just copied uninitialized data and did not depend on it later, so it should not be dangerous. Found by: clang static analyzer Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Mar 13 22:32:03 2016 (r296812) +++ head/bin/sh/exec.c Sun Mar 13 22:54:14 2016 (r296813) @@ -332,6 +332,7 @@ find_command(const char *name, struct cm if (strchr(name, '/') != NULL) { entry->cmdtype = CMDNORMAL; entry->u.index = 0; + entry->special = 0; return; } @@ -408,6 +409,7 @@ find_command(const char *name, struct cm cmdp = &loc_cmd; cmdp->cmdtype = CMDNORMAL; cmdp->param.index = idx; + cmdp->special = 0; INTON; goto success; } @@ -420,6 +422,7 @@ find_command(const char *name, struct cm } entry->cmdtype = CMDUNKNOWN; entry->u.index = 0; + entry->special = 0; return; success: @@ -588,6 +591,7 @@ addcmdentry(const char *name, struct cmd } cmdp->cmdtype = entry->cmdtype; cmdp->param = entry->u; + cmdp->special = entry->special; INTON; } @@ -604,6 +608,7 @@ defun(const char *name, union node *func INTOFF; entry.cmdtype = CMDFUNCTION; entry.u.func = copyfunc(func); + entry.special = 0; addcmdentry(name, &entry); INTON; }