--- embedaddon/sudo/compat/getgrouplist.c 2013/10/14 07:56:33 1.1.1.3 +++ embedaddon/sudo/compat/getgrouplist.c 2014/06/15 16:12:54 1.1.1.4 @@ -69,9 +69,10 @@ getgrouplist(const char *name, gid_t basegid, gid_t *g aix_setauthdb((char *) name); #endif if ((grset = getgrset(name)) != NULL) { + const char *errstr; for (cp = strtok(grset, ","); cp != NULL; cp = strtok(NULL, ",")) { - gid = atoi(cp); - if (gid != basegid) { + gid = atoid(cp, NULL, NULL, &errstr); + if (errstr == NULL && gid != basegid) { if (ngroups == grpsize) goto done; groups[ngroups++] = gid; @@ -317,7 +318,7 @@ getgrouplist(const char *name, gid_t basegid, gid_t *g setgrent(); while ((grp = getgrent()) != NULL) { - if (grp->gr_gid == basegid) + if (grp->gr_gid == basegid || grp->gr_mem == NULL) continue; for (i = 0; grp->gr_mem[i] != NULL; i++) {