From: Eric Andersen Date: Thu, 1 Aug 2002 01:31:17 +0000 (-0000) Subject: Joseph Chiu found an off-by-one bug. oops! X-Git-Tag: 0_60_4~98 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e85dbfdd80eb5f7674b17c86589d41007cc69688;p=oweals%2Fbusybox.git Joseph Chiu found an off-by-one bug. oops! --- diff --git a/libpwdgrp/initgroups.c b/libpwdgrp/initgroups.c index 57b25f343..22ba6eb1e 100644 --- a/libpwdgrp/initgroups.c +++ b/libpwdgrp/initgroups.c @@ -104,7 +104,7 @@ int initgroups(__const char *user, gid_t gid) group_list = (gid_t *) realloc(group_list, num_groups * sizeof(gid_t *)); #endif - group_list[num_groups] = group->gr_gid; + group_list[num_groups-1] = group->gr_gid; } tmp_mem++; }