[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch ping
From: |
Paul Jarc |
Subject: |
Re: patch ping |
Date: |
Mon, 28 Jul 2003 12:38:20 -0400 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
Marius Vollmer <address@hidden> wrote:
> I tweaked so setgroups function slightly so that it is hopefully
> totally type correct. Your version worked only with gids that fit
> into a fixnum (30 bits) and there might 32 bit gids out there.
Thanks, that looks good. Here's a further patch to take care of the
XXX comment. Maybe it's overly paranoid, but I figure it can't hurt.
* posix.c (scm_setgroups): Check that the gid list is not too
long.
Index: libguile/posix.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/posix.c,v
retrieving revision 1.119
diff -u -r1.119 posix.c
--- libguile/posix.c 27 Jul 2003 16:20:21 -0000 1.119
+++ libguile/posix.c 28 Jul 2003 16:35:01 -0000
@@ -253,7 +253,8 @@
}
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));
paul