From fd2d709bd2dc03930d4ed00b502e62522c6d79d4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 16 Sep 2011 09:05:37 -0400 Subject: [PATCH] Fix a crash in make_grlist_item() on 64-bit machines with strict alignment. --- plugins/sudoers/pwutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/sudoers/pwutil.c b/plugins/sudoers/pwutil.c index b511472c3..fc45787e7 100644 --- a/plugins/sudoers/pwutil.c +++ b/plugins/sudoers/pwutil.c @@ -508,16 +508,16 @@ make_grlist_item(const char *user, GETGROUPS_T *gids, int ngids) /* * Copy in group list and make pointers relative to space - * at the end of the buffer. Note that the gids array must come + * at the end of the buffer. Note that the groups array must come * immediately after struct group to guarantee proper alignment. */ grlist = (struct group_list *)cp; zero_bytes(grlist, sizeof(struct group_list)); cp += sizeof(struct group_list); - grlist->gids = (gid_t *)cp; - cp += sizeof(gid_t) * ngids; grlist->groups = (char **)cp; cp += sizeof(char *) * ngids; + grlist->gids = (gid_t *)cp; + cp += sizeof(gid_t) * ngids; /* Set key and datum. */ memcpy(cp, user, nsize); -- 2.50.0