Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Aug 2012 18:44:59 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239100 - head/lib/libpam/modules/pam_unix
Message-ID:  <201208061844.q76IixiN069430@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208061844.q76IixiN069430>