From owner-svn-src-all@FreeBSD.ORG Mon Feb 16 21:35:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3F3460E; Mon, 16 Feb 2015 21:35:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9EA093C9; Mon, 16 Feb 2015 21:35:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1GLZUwn060887; Mon, 16 Feb 2015 21:35:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1GLZUpL060886; Mon, 16 Feb 2015 21:35:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201502162135.t1GLZUpL060886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Feb 2015 21:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278867 - head/lib/libcompat/4.3 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.18-1 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: Mon, 16 Feb 2015 21:35:30 -0000 Author: pfg Date: Mon Feb 16 21:35:29 2015 New Revision: 278867 URL: https://svnweb.freebsd.org/changeset/base/278867 Log: rexec(3): prevent uninitialized access to "port" variable. CID: 1018716 (and clang static checker) Modified: head/lib/libcompat/4.3/rexec.c Modified: head/lib/libcompat/4.3/rexec.c ============================================================================== --- head/lib/libcompat/4.3/rexec.c Mon Feb 16 21:26:16 2015 (r278866) +++ head/lib/libcompat/4.3/rexec.c Mon Feb 16 21:35:29 2015 (r278867) @@ -332,10 +332,10 @@ retry: perror(hp->h_name); return (-1); } - if (fd2p == 0) { - (void) write(s, "", 1); - port = 0; - } else { + port = 0; + if (fd2p == 0) + (void) write(s, "", 1); + else { char num[8]; int s2, sin2len;