]> granicus.if.org Git - sudo/commitdiff
In sudo_make_grlist_item() the calculation of total did not include
authorTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 5 Feb 2019 23:46:30 +0000 (16:46 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 5 Feb 2019 23:46:30 +0000 (16:46 -0700)
space for pointers to the group names.

plugins/sudoers/pwutil_impl.c

index b6251ff874f1342e8bcd02f54cce98dce1a53ea9..76230a3323010770a53cafda1d012ab3a0bcae59 100644 (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: