Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2017 14:45:58 +0000 (UTC)
From:      =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315909 - in head/contrib/openpam: include/security lib/libpam
Message-ID:  <201703241445.v2OEjwdw044532@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Fri Mar 24 14:45:58 2017
New Revision: 315909
URL: https://svnweb.freebsd.org/changeset/base/315909

Log:
  Restore the NULL check that was removed in upstream r913.  It is not
  unreasonable to call pam_end() with a NULL pamh in error handling code.
  
  Reported by:	rwatson

Modified:
  head/contrib/openpam/include/security/pam_appl.h
  head/contrib/openpam/lib/libpam/pam_end.c

Modified: head/contrib/openpam/include/security/pam_appl.h
==============================================================================
--- head/contrib/openpam/include/security/pam_appl.h	Fri Mar 24 14:44:03 2017	(r315908)
+++ head/contrib/openpam/include/security/pam_appl.h	Fri Mar 24 14:45:58 2017	(r315909)
@@ -72,8 +72,7 @@ pam_close_session(pam_handle_t *_pamh,
 
 int
 pam_end(pam_handle_t *_pamh,
-	int _status)
-	OPENPAM_NONNULL((1));
+	int _status);
 
 int
 pam_get_data(const pam_handle_t *_pamh,

Modified: head/contrib/openpam/lib/libpam/pam_end.c
==============================================================================
--- head/contrib/openpam/lib/libpam/pam_end.c	Fri Mar 24 14:44:03 2017	(r315908)
+++ head/contrib/openpam/lib/libpam/pam_end.c	Fri Mar 24 14:45:58 2017	(r315909)
@@ -60,6 +60,8 @@ pam_end(pam_handle_t *pamh,
 	int i;
 
 	ENTER();
+	if (pamh == NULL)
+		RETURNC(PAM_SYSTEM_ERR);
 
 	/* clear module data */
 	while ((dp = pamh->module_data) != NULL) {



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