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

ArgumentOutOfRangeException when reading ssl streams in SslFilter #16

Closed
longshine opened this issue Oct 12, 2015 · 0 comments
Closed
Labels

Comments

@longshine
Copy link
Owner

Problem

In certain occasion, an uncaught ArgumentOutOfRangeException may be thrown in method SslHandler.ReadBuffer().

This is caused by an invalid count argument when calling SslStream.Read(byte[] buffer, int offset, int count). To avoid overflow, it should be buf.Remaining, not buf.Capacity.

Besides, the capacity of buf is incorrectly enlarged.

Related with #15.

Solution

Fixes the incorrect count and capacity while reading from a SslStream, and do not write empty buffer into a SslStream.
Commit 5d6fcbd fixed this issue.

Backward compatibility

No backward compatibility problems are expected.

Contributor

@ddfczm

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

No branches or pull requests

1 participant