diff --git a/ChangeLog b/ChangeLog index cba6787adf..2f2b527998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Mar 6 23:26:07 2011 KOSAKI Motohiro + + * process.c (proc_setmaxgroups): added negative value check. + This was suggested by Daniel Berger. Thanks Daniel! + [ruby-core:35426][Bug#4467] + Sun Mar 6 23:18:23 2011 KOSAKI Motohiro * process.c (maxgroups, proc_setmaxgroups): increase max groups diff --git a/process.c b/process.c index e55c3fda83..a216291595 100644 --- a/process.c +++ b/process.c @@ -4713,7 +4713,10 @@ proc_getmaxgroups(VALUE obj) static VALUE proc_setmaxgroups(VALUE obj, VALUE val) { - int ngroups = FIX2UINT(val); + int ngroups = FIX2INT(val); + + if (ngroups <= 0) + rb_raise(rb_eArgError, "maxgroups %d shold be positive", ngroups); if (ngroups > RB_MAX_GROUPS) ngroups = RB_MAX_GROUPS;