Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jun 2010 15:01:23 +0000 (UTC)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r209430 - stable/8/lib/libpam/modules/pam_lastlog
Message-ID:  <201006221501.o5MF1NMM076822@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Tue Jun 22 15:01:23 2010
New Revision: 209430
URL: http://svn.freebsd.org/changeset/base/209430

Log:
  merge r196650 (check that tty != NULL, prevents segfault on session close)

Modified:
  stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c
Directory Properties:
  stable/8/lib/libpam/   (props changed)

Modified: stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c
==============================================================================
--- stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Tue Jun 22 10:46:57 2010	(r209429)
+++ stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Tue Jun 22 15:01:23 2010	(r209430)
@@ -183,6 +183,11 @@ pam_sm_close_session(pam_handle_t *pamh 
 	pam_err = pam_get_item(pamh, PAM_TTY, (const void **)&tty);
 	if (pam_err != PAM_SUCCESS)
 		goto err;
+	if (tty == NULL) {
+		PAM_LOG("No PAM_TTY");
+		pam_err = PAM_SERVICE_ERR;
+		goto err;
+	}
 	if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0)
 		tty = (const char *)tty + strlen(_PATH_DEV);
 	if (*(const char *)tty == '\0')



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