Empty messages with the compression bit set should be accepted

This commit is contained in:
Jakob Borg 2015-08-18 08:42:39 +02:00
parent 9c8b907ff1
commit 6a36ec63d7
1 changed files with 1 additions and 1 deletions

View File

@ -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 {