mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-03-11 19:18:43 +00:00
Merge pull request #3726 from nspcc-dev/fix-unexpected-empty-payload
network: fix "unexpected empty payload: CMDVersion"
This commit is contained in:
commit
49267f3412
1 changed files with 3 additions and 0 deletions
|
@ -99,6 +99,9 @@ func (m *Message) Decode(br *io.BinReader) error {
|
|||
m.Flags = MessageFlag(br.ReadB())
|
||||
m.Command = CommandType(br.ReadB())
|
||||
l := br.ReadVarUint()
|
||||
if br.Err != nil {
|
||||
return br.Err
|
||||
}
|
||||
// check the length first in order not to allocate memory
|
||||
// for an empty compressed payload
|
||||
if l == 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue