From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 15:01:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EE01065672; Tue, 22 Jun 2010 15:01:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF7198FC12; Tue, 22 Jun 2010 15:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MF1Nx4076824; Tue, 22 Jun 2010 15:01:23 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MF1NMM076822; Tue, 22 Jun 2010 15:01:23 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006221501.o5MF1NMM076822@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 Jun 2010 15:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209430 - stable/8/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 15:01:23 -0000 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')