Skip to content

Instantly share code, notes, and snippets.

@tamird
Created February 26, 2016 19:12
Show Gist options
  • Save tamird/36639fb52e1962af093c to your computer and use it in GitHub Desktop.
Save tamird/36639fb52e1962af093c to your computer and use it in GitHub Desktop.
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index 0377568..c989cd2 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -774,6 +774,9 @@ func (c *Conn) writeRecord(typ recordType, data []byte) (n int, err error) {
data = data[m:]
}
c.out.freeBlock(b)
+ if err != nil {
+ return err
+ }
if typ == recordTypeChangeCipherSpec {
err = c.out.changeCipherSpec()
diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go
index 3c996ac..970ba56 100644
--- a/src/crypto/tls/handshake_client.go
+++ b/src/crypto/tls/handshake_client.go
@@ -144,7 +144,9 @@ NextCipherSuite:
}
}
- c.writeRecord(recordTypeHandshake, hello.marshal())
+ if _, err := c.writeRecord(recordTypeHandshake, hello.marshal()); err != nil {
+ return err
+ }
msg, err := c.readHandshake()
if err != nil {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment