mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
Handle sudo_get_grlist() returning NULL which can happen if
getgrouplist() fails even after allocating the appropriate amount of memory. From Stephane Chazelas
This commit is contained in:
parent
6d71b488b6
commit
b727d4309c
@ -1589,9 +1589,11 @@ runas_setgroups(void)
|
||||
#ifdef HAVE_SETAUTHDB
|
||||
aix_restoreauthdb();
|
||||
#endif
|
||||
if (sudo_setgroups(grlist->ngids, grlist->gids) < 0) {
|
||||
sudo_grlist_delref(grlist);
|
||||
grlist = NULL;
|
||||
if (grlist != NULL) {
|
||||
if (sudo_setgroups(grlist->ngids, grlist->gids) < 0) {
|
||||
sudo_grlist_delref(grlist);
|
||||
grlist = NULL;
|
||||
}
|
||||
}
|
||||
debug_return_ptr(grlist);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user