Skip to content

Fix up buffer treatment of stream parsing#4172

Merged
kddnewton merged 1 commit into
mainfrom
overflow
Jul 15, 2026
Merged

Fix up buffer treatment of stream parsing#4172
kddnewton merged 1 commit into
mainfrom
overflow

Conversation

@kddnewton

Copy link
Copy Markdown
Collaborator

A couple of things to fix, notably that we relied on the stream returning strings and relied on it not lying about how much was being written. Now we no longer trust either and we verify instead.

Supersedes #4160

A couple of things to fix, notably that we relied on the stream
returning strings and relied on it not lying about how much was
being written. Now we no longer trust either and we verify
instead.

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
@kddnewton kddnewton merged commit 70147e5 into main Jul 15, 2026
69 checks passed
@kddnewton kddnewton deleted the overflow branch July 15, 2026 17:53
@kou

kou commented Jul 16, 2026

Copy link
Copy Markdown
Member

We need the same change in Ruby because Ruby has a custom pm_source_stream_fgets_t for stdin: ruby/ruby#17914

kou added a commit to kou/ruby that referenced this pull request Jul 16, 2026
This is the same change in
ruby/prism#4172 .

Ruby has a custom `pm_source_stream_fgets_t` for stdin. We should
apply the same change to `pm_parse_stdin_fgets()` to avoid reading
`size` or more data.
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.

2 participants