From 1843e23c48f2f2de99055a0691c639cd644b050e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 6 Aug 2012 18:44:59 +0000 Subject: [PATCH] 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 --- lib/libpam/modules/pam_unix/pam_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c index 415004a4d84..5881ecf07b3 100644 --- a/lib/libpam/modules/pam_unix/pam_unix.c +++ b/lib/libpam/modules/pam_unix/pam_unix.c @@ -94,13 +94,13 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, 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);