In sudo_make_grlist_item() the calculation of total did not include

space for pointers to the group names.
This commit is contained in:
Todd C. Miller
2019-02-05 16:46:30 -07:00
parent 4f74fe3a8e
commit c92f80b79e

View File

@@ -353,6 +353,7 @@ sudo_make_grlist_item(const struct passwd *pw, char * const *unused1)
/* Allocate in one big chunk for easy freeing. */
nsize = strlen(pw->pw_name) + 1;
total = sizeof(*grlitem) + nsize;
total += sizeof(char *) * gidlist->ngids;
total += groupname_len * gidlist->ngids;
again: