diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-22 22:28:31 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-22 22:28:31 +0000 |
commit | fc6fd9a33c048b0b2b7c02d52e4fcbe9f722789c (patch) | |
tree | 7351e997b0a3ae097e0ab517098274ec2b07f77e /ext/socket | |
parent | f3991a5d4d1256a811aad6a74e0f03ffc20448f4 (diff) | |
download | ruby-fc6fd9a33c048b0b2b7c02d52e4fcbe9f722789c.tar.gz |
ext/socket/init.c (rsock_init_sock): reject reserved FDs
[ruby-core:72445] [Bug #11862]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r-- | ext/socket/init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c index bc01217641..66da534a58 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -61,7 +61,7 @@ rsock_init_sock(VALUE sock, int fd) { rb_io_t *fp; - if (!is_socket(fd)) { + if (!is_socket(fd) || rb_reserved_fd_p(fd)) { errno = EBADF; rb_sys_fail("not a socket file descriptor"); } |