mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
merge revision(s) 53259: [Backport #11862]
* 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/branches/ruby_2_2@54039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f429ee01d2
commit
cb37e4013e
3 changed files with 7 additions and 2 deletions
|
@ -58,7 +58,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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue