Project

General

Profile

Actions

Bug #18880

open

IO#sysread on Windows does not validate arguments

Added by javanthropus (Jeremy Bopp) about 1 month ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
[ruby-core:109054]

Description

When passing an invalid number of bytes to read, such as -1 , to IO#sysread on Linux, an ArgumentError is raised. On Windows Errno::EINVAL is raised instead.

r, w = IO.pipe
r.sysread(-1)

This raises ArgumentError on non-Windows and Errno::EINVAL on Windows.

No data to display

Actions

Also available in: Atom PDF