public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nss: add assert to DB_LOOKUP_FCT (BZ #28752)
@ 2022-05-26  0:20 Sam James
  2022-05-26  0:20 ` [PATCH 2/2] nss: handle stat failure in check_reload_and_get " Sam James
  2022-05-27 17:07 ` [PATCH 1/2] nss: add assert to DB_LOOKUP_FCT " Adhemerval Zanella
  0 siblings, 2 replies; 17+ messages in thread
From: Sam James @ 2022-05-26  0:20 UTC (permalink / raw)
  To: libc-alpha

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>
---
 nss/XXX-lookup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/nss/XXX-lookup.c b/nss/XXX-lookup.c
index db95937674..793dde976e 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
    <https://www.gnu.org/licenses/>.  */
 
+#include <assert.h>
 #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)
-- 
2.35.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-06-06 16:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26  0:20 [PATCH 1/2] nss: add assert to DB_LOOKUP_FCT (BZ #28752) Sam James
2022-05-26  0:20 ` [PATCH 2/2] nss: handle stat failure in check_reload_and_get " Sam James
2022-05-26  6:49   ` Sam James
2022-06-04  3:26     ` DJ Delorie
2022-06-04  3:48       ` Sam James
2022-06-04  6:30       ` Sam James
2022-06-04 20:51         ` DJ Delorie
2022-06-04 21:29           ` Sam James
2022-06-04 22:11             ` Sam James
2022-06-04 22:13               ` Sam James
2022-06-05  0:55               ` DJ Delorie
2022-06-05  3:56                 ` Sam James
2022-06-05  6:23                 ` Andreas Schwab
2022-06-06 16:14                   ` DJ Delorie
2022-05-27 17:04   ` Adhemerval Zanella
2022-05-27 17:07 ` [PATCH 1/2] nss: add assert to DB_LOOKUP_FCT " Adhemerval Zanella
2022-06-04  3:48   ` Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).