From 4cc9a707382d91a10a28408fa46438da02f7179e Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 23 Dec 2004 14:36:53 +0000 Subject: * process.c (proc_setgroups): check if the argument lenght is modified. fixed: [ruby-dev:25285] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'process.c') diff --git a/process.c b/process.c index 67c4d3816..9541c600d 100644 --- a/process.c +++ b/process.c @@ -2464,7 +2464,7 @@ proc_setgroups(VALUE obj, VALUE ary) groups = ALLOCA_N(gid_t, ngroups); - for (i = 0; i < ngroups; i++) { + for (i = 0; i < ngroups && i < RARRAY(ary)->len; i++) { VALUE g = RARRAY(ary)->ptr[i]; if (FIXNUM_P(g)) { -- cgit