network: check compressed payload size in decompress
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
13999252c6
commit
34b1b52784
3 changed files with 36 additions and 0 deletions
|
@ -18,6 +18,13 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestMessageDecodeFuzzCases(t *testing.T) {
|
||||
raw := []byte("10\x0200")
|
||||
m := new(Message)
|
||||
r := io.NewBinReaderFromBuf(raw)
|
||||
require.NotPanics(t, func() { _ = m.Decode(r) })
|
||||
}
|
||||
|
||||
func TestEncodeDecodeVersion(t *testing.T) {
|
||||
// message with tiny payload, shouldn't be compressed
|
||||
expected := NewMessage(CMDVersion, &payload.Version{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue