[前][次][番号順一覧][スレッド一覧]

ruby-changes:18999

From: kosaki <ko1@a...>
Date: Sun, 6 Mar 2011 23:42:12 +0900 (JST)
Subject: [ruby-changes:18999] Ruby:r31035 (trunk): * process.c (proc_setmaxgroups): added negative value check.

kosaki	2011-03-06 23:28:02 +0900 (Sun, 06 Mar 2011)

  New Revision: 31035

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31035

  Log:
    * process.c (proc_setmaxgroups): added negative value check.
      This was suggested by Daniel Berger. Thanks Daniel!
      [ruby-core:35426][Bug#4467]

  Modified files:
    trunk/ChangeLog
    trunk/process.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31034)
+++ ChangeLog	(revision 31035)
@@ -1,3 +1,9 @@
+Sun Mar  6 23:26:07 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* 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  <kosaki.motohiro@g...>
 
 	* process.c (maxgroups, proc_setmaxgroups): increase max groups
Index: process.c
===================================================================
--- process.c	(revision 31034)
+++ process.c	(revision 31035)
@@ -4713,8 +4713,11 @@
 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;
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]