about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/getent.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/nss/getent.c b/nss/getent.c
index 7d9422373c..0e39836179 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -518,6 +518,12 @@ initgroups_keys (int number, char *key[])
   size_t grpslen = ngrps * sizeof (gid_t);
   gid_t *grps = alloca (grpslen);
 
+  if (number == 0)
+    {
+      fprintf (stderr, _("Enumeration not supported on %s\n"), "initgroups");
+      return 3;
+    }
+
   for (int i = 0; i < number; ++i)
     {
       int no = ngrps;