1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
normal 2015-12-22 22:28:31 +00:00
parent 299e5e52d6
commit 1abef5bd11
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Wed Dec 23 07:15:17 2015 Eric Wong <e@80x24.org>
* ext/socket/init.c (rsock_init_sock): reject reserved FDs
[ruby-core:72445] [Bug #11862]
Wed Dec 23 02:59:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (__STDC_WANT_LIB_EXT1__): necessary to use memset_s

View file

@ -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");
}