Преглед изворни кода

Empty messages with the compression bit set should be accepted

Jakob Borg пре 10 година
родитељ
комит
6a36ec63d7
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      protocol.go

+ 1 - 1
protocol.go

@@ -412,7 +412,7 @@ func (c *rawConnection) readMessage() (hdr header, msg encodable, err error) {
 	}
 
 	msgBuf := c.rdbuf0
-	if hdr.compression {
+	if hdr.compression && msglen > 0 {
 		c.rdbuf1 = c.rdbuf1[:cap(c.rdbuf1)]
 		c.rdbuf1, err = lz4.Decode(c.rdbuf1, c.rdbuf0)
 		if err != nil {