Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl: prevent SSLSocket#sysread* from leaking uninitialized data #153

Merged
merged 2 commits into from
Sep 24, 2017

Conversation

rhenium
Copy link
Member

@rhenium rhenium commented Sep 22, 2017

Set the length of the buffer string to 0 first, and adjust to the size
successfully read by the SSL_read() call later. This is needed because
the buffer string may be provided by the caller.

The sleep was to ensure that the SSLSocket#read_nonblock will get
close_notify alert. A simple IO.select will suffice.
Set the length of the buffer string to 0 first, and adjust to the size
successfully read by the SSL_read() call later. This is needed because
the buffer string may be provided by the caller.
@rhenium rhenium merged commit 295dd1d into ruby:maint Sep 24, 2017
@HoneyryderChuck
Copy link
Contributor

This fixes a bug using SSLSocket#read_nonblock with a buffer as a second argument.

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

Successfully merging this pull request may close these issues.

2 participants