svn commit: r239100 - head/lib/libpam/modules/pam_unix
Dimitry Andric
dim at FreeBSD.org
Mon Aug 6 18:45:00 UTC 2012
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);
More information about the svn-src-all
mailing list