From e55724fcb2f630d9fabf2eb0f3d6e1b1aaf99381 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 6 Aug 2012 18:44:59 +0000 Subject: 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(-) (limited to 'lib/libpam/modules/pam_unix/pam_unix.c') diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c index 415004a..5881ecf 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); -- cgit v1.1