summaryrefslogtreecommitdiff
path: root/libc/pwd_grp
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-01 01:31:17 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-01 01:31:17 +0000
commit205e2b7199bac43f0feb716d24ee7ed6f23fe05c (patch)
treef1a2067cec042a2b504457d5998abbc503a98c98 /libc/pwd_grp
parent3d909b2123af44ad8cc7ae02c099f8a25d00261b (diff)
Joseph Chiu <josephc@idealab.com> found an off-by-one bug. oops!
Diffstat (limited to 'libc/pwd_grp')
-rw-r--r--libc/pwd_grp/initgroups.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/pwd_grp/initgroups.c b/libc/pwd_grp/initgroups.c
index f3c0604f5..98b2626f3 100644
--- a/libc/pwd_grp/initgroups.c
+++ b/libc/pwd_grp/initgroups.c
@@ -63,7 +63,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++;
}