diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-14 02:44:57 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-14 02:44:57 +0000 |
commit | d24e1dac2b66afc3265065209686970481fb5367 (patch) | |
tree | 8275e1a083e38124cb3a7d20b76c004ec250afe5 /thread.c | |
parent | 4e7c8bbe034e7f96b4d2880f99cf1bc75d4c6097 (diff) | |
download | ruby-d24e1dac2b66afc3265065209686970481fb5367.tar.gz |
* thread.c (rb_fd_rcopy): added an argument guard.
Patch by NAKAMURA Usaku. [Bug #5306] [ruby-core:39435]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2469,7 +2469,9 @@ rb_fd_rcopy(fd_set *dst, rb_fdset_t *src) { 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"); } |