Actions
Bug #18880
closedIO#sysread on Windows does not validate arguments
Bug #18880:
IO#sysread on Windows does not validate arguments
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
Updated by javanthropus (Jeremy Bopp) almost 4 years ago
I'm interested in submitting a patch for this, but which behavior is considered correct?
Updated by nobu (Nobuyoshi Nakada) almost 4 years ago
The ArgumentError is correct.
Even on Windows, sysread(-2) raises an ArgumentError too.
At rounding up len in io.c:io_setstrbuf(), negative values are not considered.
Updated by javanthropus (Jeremy Bopp) almost 4 years ago
I submitted PR https://github.com/ruby/ruby/pull/6354 with a simple fix. I don't have a Windows system to test with though, so I couldn't verify that it works.
Updated by javanthropus (Jeremy Bopp) almost 4 years ago
- Status changed from Open to Closed
Applied in changeset git|684353fc03afd6e7c887b65bd18f0b3aeb98101c.
[Win32] Negative length IO#sysread
Raise ArgumentError in IO#sysread on Windows when given a negative
length.
Fixes [Bug #18880]
Actions