mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 09:42:22 +00:00
network: handle length mismatch in decompression routine
It's a protocol level error when uncompressed payload size doesn't match the one specified in the header.
This commit is contained in:
parent
c114c4dd1c
commit
1f46f73d12
1 changed files with 4 additions and 1 deletions
|
@ -30,5 +30,8 @@ func decompress(source []byte) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dest[:size], nil
|
||||
if uint32(size) != length {
|
||||
return nil, errors.New("decompressed payload size doesn't match header")
|
||||
}
|
||||
return dest, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue