Skip to content

Commit a63890f

Browse files
committed
sudoers_policy_store_result: Fix potential NULL pointer deref
sudo_get_gidlist() can return NULL value
1 parent cc3d47b commit a63890f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugins/sudoers/policy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ sudoers_policy_store_result(struct sudoers_context *ctx, bool accepted,
812812
struct gid_list *gidlist;
813813

814814
/* Only use results from a group db query, not the front end. */
815-
gidlist = sudo_get_gidlist(ctx->runas.pw, ENTRY_TYPE_QUERIED);
815+
if ((gidlist = sudo_get_gidlist(ctx->runas.pw, ENTRY_TYPE_QUERIED)) == NULL)
816+
goto oom;
816817

817818
/* We reserve an extra spot in the list for the effective gid. */
818819
glsize = sizeof("runas_groups=") - 1 +

0 commit comments

Comments
 (0)