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

ruby-changes:21217

From: kosaki <ko1@a...>
Date: Wed, 14 Sep 2011 11:45:20 +0900 (JST)
Subject: [ruby-changes:21217] kosaki:r33266 (trunk): * thread.c (rb_fd_rcopy): added an argument guard.

kosaki	2011-09-14 11:44:57 +0900 (Wed, 14 Sep 2011)

  New Revision: 33266

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

  Log:
    * thread.c (rb_fd_rcopy): added an argument guard.
      Patch by NAKAMURA Usaku. [Bug #5306] [ruby-core:39435]

  Modified files:
    trunk/ChangeLog
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33265)
+++ ChangeLog	(revision 33266)
@@ -1,3 +1,8 @@
+Wed Sep 14 11:43:37 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (rb_fd_rcopy): added an argument guard.
+	  Patch by NAKAMURA Usaku. [Bug #5306] [ruby-core:39435]
+
 Tue Sep 13 20:21:49 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/pstore.rb, test/test_pstore.rb: suppress warnings with -v.
Index: thread.c
===================================================================
--- thread.c	(revision 33265)
+++ thread.c	(revision 33266)
@@ -2469,7 +2469,9 @@
 {
     int max = rb_fd_max(src);
 
-    if (max > FD_SETSIZE) {
+    /* we assume src is the result of select() with dst, so dst should be
+     * larger or equal than src. */
+    if (max > FD_SETSIZE || max > dst->fd_count) {
 	rb_raise(rb_eArgError, "too large fdsets");
     }
 

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

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