Backport r35595 - Windows: FD_SET and FD_SETSIZE segv due different compilation flags
Please backport r35595 to ruby_1_9_3 branch. It contains a SEGV fix for FD_SETSIZE/FD_SET that affects pre-compiled extensions with different FD_SETSIZE than the build Ruby.
Updated by naruse (Yui NARUSE) almost 9 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r35783.
Luis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 35595: [Backport #6446]
* include/ruby/win32.h (FD_SET): change function to macro. To avoid buffer overflow when smaller FD_SETSISE is used in ext libraries. * win32/win32.c (rb_w32_fdset): this function is not used anymore. But we leave this for compatibility. * win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller FD_SETSISE is used in ext libraries. Dereference of fd_set pointer causes SEGV. * test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for above. * ext/-test-/win32/fd_setsize/depend: ditto. * ext/-test-/win32/fd_setsize/extconf.rb: ditto. * ext/-test-/win32/fd_setsize/fd_setsize.c: ditto. [ruby-core:44588] [Bug #6352]