From owner-svn-src-all@FreeBSD.ORG Mon Aug 6 18:45:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC62106564A; Mon, 6 Aug 2012 18:45:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1826F8FC0C; Mon, 6 Aug 2012 18:45:00 +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 q76IixEC069432; Mon, 6 Aug 2012 18:44:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76IixiN069430; Mon, 6 Aug 2012 18:44:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201208061844.q76IixiN069430@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Aug 2012 18:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239100 - head/lib/libpam/modules/pam_unix 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: Mon, 06 Aug 2012 18:45:00 -0000 Author: dim Date: Mon Aug 6 18:44:59 2012 New Revision: 239100 URL: http://svn.freebsd.org/changeset/base/239100 Log: Fix an instance in pam_krb5(8), where the variable 'user' could be used uninitialized. Found by: clang 3.2 Reviewed by: des MFC after: 1 week Modified: head/lib/libpam/modules/pam_unix/pam_unix.c Modified: head/lib/libpam/modules/pam_unix/pam_unix.c ============================================================================== --- head/lib/libpam/modules/pam_unix/pam_unix.c Mon Aug 6 18:40:14 2012 (r239099) +++ head/lib/libpam/modules/pam_unix/pam_unix.c Mon Aug 6 18:44:59 2012 (r239100) @@ -94,13 +94,13 @@ pam_sm_authenticate(pam_handle_t *pamh, const char *pass, *user, *realpw, *prompt; if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) { - pwd = getpwnam(getlogin()); + user = getlogin(); } else { retval = pam_get_user(pamh, &user, NULL); if (retval != PAM_SUCCESS) return (retval); - pwd = getpwnam(user); } + pwd = getpwnam(user); PAM_LOG("Got user: %s", user);