aboutsummaryrefslogtreecommitdiff
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 7d94223..0e39836 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;