Skip to content

Fix Buffering length edge cases - #1100

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/buffering-length-edges
Open

Fix Buffering length edge cases#1100
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/buffering-length-edges

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Align OpenSSL::Buffering read length handling with IO: reject negative read sizes, return an empty String for gets(..., 0), and stop filling once a positive gets limit is available.

Reproduction

The current implementation accepts negative lengths in read, readpartial, and read_nonblock; gets(separator, 0) reads through separator/EOF and returns nil at EOF; and a positive limited gets continues reading until separator/EOF after the requested bytes are buffered.

Verification

  • Current candidate: 630 tests / 4,624 assertions, zero failures/errors, two expected FIPS omissions
  • Release candidate: 597 tests / 4,411 assertions, zero failures/errors, two expected FIPS omissions
  • Focused IO-parity and bounded-read models pass
  • Native build succeeds with -Werror; gem build/install and Songstats Rails/OpenSSL integration pass

No public API is added; this corrects documented IO-compatible edge behavior.

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.

1 participant