From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2130) id 289493874762; Thu, 9 Jun 2022 01:30:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 289493874762 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: DJ Delorie To: glibc-cvs@sourceware.org Subject: [glibc] nss: add assert to DB_LOOKUP_FCT (BZ #28752) X-Act-Checkin: glibc X-Git-Author: Sam James X-Git-Refname: refs/heads/master X-Git-Oldrev: 2c9af8421d2b4a7fcce163e7bc81a118d22fd346 X-Git-Newrev: 3fdf0a205b622e40fa7e3c4ed1e4ed4d5c6c5380 Message-Id: <20220609013001.289493874762@sourceware.org> Date: Thu, 9 Jun 2022 01:30:01 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 01:30:02 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3fdf0a205b622e40fa7e3c4ed1e4ed4d5c6c5380 commit 3fdf0a205b622e40fa7e3c4ed1e4ed4d5c6c5380 Author: Sam James Date: Sun Jun 5 04:57:09 2022 +0100 nss: add assert to DB_LOOKUP_FCT (BZ #28752) It's interesting if we have a null action list, so an assert is worthwhile. Suggested-by: DJ Delorie Signed-off-by: Sam James Reviewed-by: DJ Delorie Diff: --- nss/XXX-lookup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nss/XXX-lookup.c b/nss/XXX-lookup.c index db95937674..bfc57b8e64 100644 --- a/nss/XXX-lookup.c +++ b/nss/XXX-lookup.c @@ -15,6 +15,7 @@ License along with the GNU C Library; if not, see . */ +#include #include "nsswitch.h" /*******************************************************************\ @@ -54,6 +55,10 @@ DB_LOOKUP_FCT (nss_action_list *ni, const char *fct_name, const char *fct2_name, *ni = DATABASE_NAME_SYMBOL; + /* We want to know about it if we've somehow got a NULL action list; + in the past, we had bad state if seccomp interfered with setup. */ + assert(*ni != NULL); + return __nss_lookup (ni, fct_name, fct2_name, fctp); } libc_hidden_def (DB_LOOKUP_FCT)