From: Motohiro KOSAKI Date: 2011-03-06T23:31:57+09:00 Subject: [ruby-core:35438] [Ruby 1.8 - Bug #4467] Process.maxgroups= should only accept numeric values Issue #4467 has been updated by Motohiro KOSAKI. Hi Daniel, I've applyed the suggest of Coeemnt#1 (ie. negative value check) by r31035 into trunk. But I can't reproduce your mention of to accept non numeric value. At least, trunk seems to reject non numeric value already. % ./ruby-193 -e 'Process.maxgroups="100"' -e:1:in `maxgroups=': can't convert String into Integer (TypeError) from -e:1:in `
' So, could you please post your test code? ---------------------------------------- Bug #4467: Process.maxgroups= should only accept numeric values http://redmine.ruby-lang.org/issues/4467 Author: Daniel Berger Status: Open Priority: Normal Assignee: Category: core Target version: Ruby 1.8.7 ruby -v: - At the moment Process.maxgroups= accepts non-numeric values, which results in defaulting to 4096. IMO it should raise a TypeError. diff --git a/process.orig b/process.c index f658fa9..c3c4a1f 100644 --- a/process.orig +++ b/process.c @@ -2752,7 +2752,7 @@ proc_getmaxgroups(obj) static VALUE proc_setmaxgroups(VALUE obj, VALUE val) { - size_t ngroups = FIX2INT(val); + size_t ngroups = NUM2INT(val); if (ngroups > 4096) ngroups = 4096; -- http://redmine.ruby-lang.org