From fc6fd9a33c048b0b2b7c02d52e4fcbe9f722789c Mon Sep 17 00:00:00 2001 From: normal Date: Tue, 22 Dec 2015 22:28:31 +0000 Subject: 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 --- ext/socket/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/socket') 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"); } -- cgit v1.2.3