From owner-svn-src-head@freebsd.org Fri Mar 24 14:45:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 978F1D19307; Fri, 24 Mar 2017 14:45:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66BD11644; Fri, 24 Mar 2017 14:45:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2OEjwfY044534; Fri, 24 Mar 2017 14:45:58 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2OEjwdw044532; Fri, 24 Mar 2017 14:45:58 GMT (envelope-from des@FreeBSD.org) Message-Id: <201703241445.v2OEjwdw044532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 24 Mar 2017 14:45:58 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2017 14:45:59 -0000 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) {