mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
(scm_setgroups): Check that the gid list is not too long. Thanks to
Paul Jarc!
This commit is contained in:
parent
22f2cf2d9a
commit
2eb78d0670
1 changed files with 2 additions and 1 deletions
|
@ -253,7 +253,8 @@ SCM_DEFINE (scm_setgroups, "setgroups", 1, 0, 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
size = ngroups * sizeof (GETGROUPS_T);
|
size = ngroups * sizeof (GETGROUPS_T);
|
||||||
/* XXX - if (size / sizeof (GETGROUPS_T) != ngroups) out-of-range */
|
if (size / sizeof (GETGROUPS_T) != ngroups)
|
||||||
|
SCM_OUT_OF_RANGE (SCM_ARG1, SCM_MAKINUM (ngroups));
|
||||||
groups = scm_malloc (size);
|
groups = scm_malloc (size);
|
||||||
for(i = 0; i < ngroups; i++)
|
for(i = 0; i < ngroups; i++)
|
||||||
groups [i] = SCM_NUM2ULONG (1, SCM_VECTOR_REF (group_vec, i));
|
groups [i] = SCM_NUM2ULONG (1, SCM_VECTOR_REF (group_vec, i));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue