aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2010-06-22 19:56:07 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2010-06-22 19:56:07 +0000
commit838357d317e2fe9ddccce68b0bbc3d096bde4806 (patch)
tree43aa444dca62d23e9d2099152a524ed91accdc7b
parent5483bc18e4dc0601028167b1366e93a1ad550a4e (diff)
downloadsrc-838357d317e2fe9ddccce68b0bbc3d096bde4806.tar.gz
src-838357d317e2fe9ddccce68b0bbc3d096bde4806.zip
merge r196650 from head (via stable/8): tty might be NULL
Approved by: re (kib@)
Notes
Notes: svn path=/releng/8.1/; revision=209441
-rw-r--r--lib/libpam/modules/pam_lastlog/pam_lastlog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libpam/modules/pam_lastlog/pam_lastlog.c b/lib/libpam/modules/pam_lastlog/pam_lastlog.c
index 817d1f3ba793..9899f8d16faf 100644
--- a/lib/libpam/modules/pam_lastlog/pam_lastlog.c
+++ b/lib/libpam/modules/pam_lastlog/pam_lastlog.c
@@ -183,6 +183,11 @@ pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused,
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')