From: "javanthropus (Jeremy Bopp)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:109880] [Ruby master Bug#18880] IO#sysread on Windows does not validate arguments
Date: Sat, 10 Sep 2022 21:46:01 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-99121.20220910214601.692@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-18880.20220626162646.692@ruby-lang.org
Issue #18880 has been updated by javanthropus (Jeremy Bopp).
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.
----------------------------------------
Bug #18880: IO#sysread on Windows does not validate arguments
https://bugs.ruby-lang.org/issues/18880#change-99121
* Author: javanthropus (Jeremy Bopp)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
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.
``` ruby
r, w = IO.pipe
r.sysread(-1)
```
This raises `ArgumentError` on non-Windows and `Errno::EINVAL` on Windows.
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2022-09-10 21:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-26 16:26 [ruby-core:109054] [Ruby master Bug#18880] IO#sysread on Windows does not validate arguments javanthropus (Jeremy Bopp)
2022-09-04 23:13 ` [ruby-core:109843] " javanthropus (Jeremy Bopp)
2022-09-08 8:56 ` [ruby-core:109846] " nobu (Nobuyoshi Nakada)
2022-09-10 21:46 ` javanthropus (Jeremy Bopp) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-99121.20220910214601.692@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).