From 4155f97bb0bc857c5fec8b71cd0bc33e19e11107 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 23 Dec 2004 14:36:53 +0000 Subject: [PATCH] * process.c (proc_setgroups): check if the argument lenght is modified. fixed: [ruby-dev:25285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ process.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e7b893d056..c1cd743671 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 23 23:36:28 2004 Nobuyoshi Nakada + + * process.c (proc_setgroups): check if the argument lenght is + modified. fixed: [ruby-dev:25285] + Thu Dec 23 19:08:41 2004 Tanaka Akira * rubyio.h: rename FMODE_UNSEEKABLE to FMODE_DUPLEX. diff --git a/process.c b/process.c index f3b8426f6d..c42a91903a 100644 --- a/process.c +++ b/process.c @@ -2697,7 +2697,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)) {