1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

(scm_setgroups): Check that the gid list is not too long. Thanks to

Paul Jarc!
This commit is contained in:
Marius Vollmer 2003-09-15 12:36:57 +00:00
parent 22f2cf2d9a
commit 2eb78d0670

View file

@ -253,7 +253,8 @@ SCM_DEFINE (scm_setgroups, "setgroups", 1, 0, 0,
}
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);
for(i = 0; i < ngroups; i++)
groups [i] = SCM_NUM2ULONG (1, SCM_VECTOR_REF (group_vec, i));