summaryrefslogtreecommitdiff
path: root/ext/socket/init.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-22 22:28:31 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-22 22:28:31 +0000
commit1abef5bd1138aa5565709a20a928bf3398664ab9 (patch)
tree7351e997b0a3ae097e0ab517098274ec2b07f77e /ext/socket/init.c
parent299e5e52d679f17b92db4d70651cd15c320c3fe2 (diff)
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/init.c')
-rw-r--r--ext/socket/init.c2
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");
}