]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nss: add assert to DB_LOOKUP_FCT (BZ #28752)
authorSam James <sam@gentoo.org>
Sun, 5 Jun 2022 03:57:09 +0000 (04:57 +0100)
committerDJ Delorie <dj@redhat.com>
Mon, 13 Jun 2022 22:15:25 +0000 (18:15 -0400)
It's interesting if we have a null action list,
so an assert is worthwhile.

Suggested-by: DJ Delorie <dj@redhat.com>
Signed-off-by: Sam James <sam@gentoo.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
(cherry picked from commit 3fdf0a205b622e40fa7e3c4ed1e4ed4d5c6c5380)

nss/XXX-lookup.c

index dbc87868dd408d9f4ba84014fbedcf8e91812302..343fd9869bd12714f8673d2648697ac0da17a115 100644 (file)
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <assert.h>
 #include "nsswitch.h"
 
 /*******************************************************************\
@@ -55,6 +56,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)