ruby-changes:41850
From: usa <ko1@a...>
Date: Thu, 25 Feb 2016 17:50:04 +0900 (JST)
Subject: [ruby-changes:41850] usa:r53924 (ruby_2_1): merge revision(s) 53259: [Backport #11862]
usa 2016-02-25 17:50:44 +0900 (Thu, 25 Feb 2016) New Revision: 53924 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53924 Log: merge revision(s) 53259: [Backport #11862] * ext/socket/init.c (rsock_init_sock): reject reserved FDs [ruby-core:72445] [Bug #11862] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/ext/socket/init.c branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 53923) +++ ruby_2_1/ChangeLog (revision 53924) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Thu Feb 25 17:48:16 2016 Eric Wong <e@8...> + + * ext/socket/init.c (rsock_init_sock): reject reserved FDs + [ruby-core:72445] [Bug #11862] + Thu Feb 25 17:38:59 2016 Eric Wong <e@8...> * ext/socket/init.c (rsock_init_sock): check FD after validating Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 53923) +++ ruby_2_1/version.h (revision 53924) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.9" #define RUBY_RELEASE_DATE "2016-02-25" -#define RUBY_PATCHLEVEL 445 +#define RUBY_PATCHLEVEL 446 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 2 Index: ruby_2_1/ext/socket/init.c =================================================================== --- ruby_2_1/ext/socket/init.c (revision 53923) +++ ruby_2_1/ext/socket/init.c (revision 53924) @@ -48,12 +48,12 @@ rsock_init_sock(VALUE sock, int fd) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/socket/init.c#L48 if (fstat(fd, &sbuf) < 0) rb_sys_fail("fstat(2)"); - if (!S_ISSOCK(sbuf.st_mode)) { + if (!S_ISSOCK(sbuf.st_mode) || rb_reserved_fd_p(fd)) { errno = EBADF; rb_sys_fail("not a socket file descriptor"); } #else - if (!rb_w32_is_socket(fd)) { + if (!rb_w32_is_socket(fd) || rb_reserved_fd_p(fd)) { errno = EBADF; rb_sys_fail("not a socket file descriptor"); } Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r53259 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/