From c18578632fd3c9e513e613a86ba2b7c4ebee6c45 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 30 Sep 2014 18:22:48 +0400 Subject: Imported Upstream version 8.23 --- lib/mgetgroups.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/mgetgroups.c') diff --git a/lib/mgetgroups.c b/lib/mgetgroups.c index 2d82f45c..9d302e74 100644 --- a/lib/mgetgroups.c +++ b/lib/mgetgroups.c @@ -1,6 +1,6 @@ /* mgetgroups.c -- return a list of the groups a user or current process is in - Copyright (C) 2007-2013 Free Software Foundation, Inc. + Copyright (C) 2007-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -133,7 +133,7 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups) return -1; } - if (!username && gid != (gid_t) -1) + if (max_n_groups == 0 || (!username && gid != (gid_t) -1)) max_n_groups++; g = realloc_groupbuf (NULL, max_n_groups); if (g == NULL) -- cgit v1.2.3