diff --git a/conn/channel.go b/conn/channel.go index d55e81e8..7f13f21e 100644 --- a/conn/channel.go +++ b/conn/channel.go @@ -252,7 +252,7 @@ func decodeChannelMessage(raw []byte) (*channelMessage, error) { if err != nil { logrus.Println("binary.Read failed:", err) } - if uint32(len(raw)) < result.length { + if uint32(len(raw)) < result.length || result.length < messageHeaderLength { return nil, errors.New("uncomplete message") } err = binary.Read(buf, binary.BigEndian, &result.typeN)