From 731e796711d4554f67d7f14aaf5b9f15696090cc Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 18 Mar 2019 14:08:21 -0600 Subject: [PATCH] Fix the counting of supplementary groups on AIX. We should not assume that basegid will be present in the list of gids returned by getgrset(). --- lib/util/getgrouplist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util/getgrouplist.c b/lib/util/getgrouplist.c index 253736385..aff795be0 100644 --- a/lib/util/getgrouplist.c +++ b/lib/util/getgrouplist.c @@ -144,6 +144,7 @@ sudo_getgrouplist2_v1(const char *name, GETGROUPS_T basegid, /* Dynamically-sized group vector, count groups and alloc. */ grpsize = 1; /* reserve one for basegid */ if (*grset != '\0') { + grpsize++; /* at least one supplementary group */ for (cp = grset; *cp != '\0'; cp++) { if (*cp == ',') grpsize++; -- 2.50.1