From 2eb78d06706e3ae870fca03c4611e33fd9c4c185 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 15 Sep 2003 12:36:57 +0000 Subject: [PATCH] (scm_setgroups): Check that the gid list is not too long. Thanks to Paul Jarc! --- libguile/posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libguile/posix.c b/libguile/posix.c index 2fa573f40..04113e3f2 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -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));