Skip to content

Conversation

@casperisfine
Copy link
Contributor

Fix: #66

If length is 0, IO#pread don't even try to read the IO, it simply return the buffer untouched if there is one or a new empty buffer otherwise.

It also doesn't validate the offset when length is 0.

cc @jdelStrother @kou

If length is 0, IO#pread don't even try to read the IO,
it simply return the buffer untouched if there is one
or a new empty buffer otherwise.

It also doesn't validate the offset when length is 0.
@kou kou merged commit 37e9279 into ruby:master Oct 5, 2023
@kou
Copy link
Member

kou commented Oct 5, 2023

Thanks!

matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 5, 2023
(ruby/stringio#67)

Fix: ruby/stringio#66

If length is 0, IO#pread don't even try to read the IO, it simply return
the buffer untouched if there is one or a new empty buffer otherwise.

It also doesn't validate the offset when length is 0.

cc @jdelStrother @kou

ruby/stringio@37e9279337

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
@jdelStrother
Copy link

Thanks both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pread(0,0) raises EOFError

4 participants