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
crypto/tls: Conn#Read blocks on zero length slice argument #7775
Labels
Milestone
Comments
It's possible that people were calling tlsConn.Read(nil) for the side effect of doing the TLS handshake and getting that error value. Any fix (at least so late in Go 1.3) should probably preserve that property, like: func (c *Conn) Read(b []byte) (n int, err error) { if err = c.Handshake(); err != nil { return } if len(b) == 0 { return } |
I'd (obviously) vote for including it in 1.3, especially with Brad's suggested change: 1. It seems very unlikely that anyone is using crypto/tls this way with the *expectation* that it will block. 2. If the check for zero-length is after the handshake check, it doesn't break other reasonable current uses of tls.Conn#Read like checking for an error in the handshake. |
CL https://golang.org/cl/88340043 mentions this issue. |
This issue was closed by revision 853c99d. Status changed to Fixed. |
FiloSottile
pushed a commit
to FiloSottile/go
that referenced
this issue
Oct 12, 2018
Fixes golang#7775 LGTM=rsc R=agl, rsc CC=golang-codereviews https://golang.org/cl/88340043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by aalevy:
The text was updated successfully, but these errors were encountered: