svn commit: r239521 - stable/9/lib/libpam/modules/pam_unix

Dimitry Andric dim at FreeBSD.org
Tue Aug 21 19:13:54 UTC 2012


Author: dim
Date: Tue Aug 21 19:13:53 2012
New Revision: 239521
URL: http://svn.freebsd.org/changeset/base/239521

Log:
  MFC r239100:
  
  Fix an instance in pam_krb5(8), where the variable 'user' could be used
  uninitialized.
  
  Found by:	clang 3.2
  Reviewed by:	des

Modified:
  stable/9/lib/libpam/modules/pam_unix/pam_unix.c
Directory Properties:
  stable/9/lib/libpam/   (props changed)

Modified: stable/9/lib/libpam/modules/pam_unix/pam_unix.c
==============================================================================
--- stable/9/lib/libpam/modules/pam_unix/pam_unix.c	Tue Aug 21 19:11:12 2012	(r239520)
+++ stable/9/lib/libpam/modules/pam_unix/pam_unix.c	Tue Aug 21 19:13:53 2012	(r239521)
@@ -96,13 +96,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-stable-9 mailing list