payload: add a check for zero-length address list
Which is also present in C# code. Thanks, @AnnaShaleva.
This commit is contained in:
parent
5abec520c7
commit
a44cb99df6
2 changed files with 30 additions and 6 deletions
|
@ -80,6 +80,9 @@ func NewAddressList(n int) *AddressList {
|
|||
// DecodeBinary implements Serializable interface.
|
||||
func (p *AddressList) DecodeBinary(br *io.BinReader) {
|
||||
br.ReadArray(&p.Addrs, MaxAddrsCount)
|
||||
if len(p.Addrs) == 0 {
|
||||
br.Err = errors.New("no addresses listed")
|
||||
}
|
||||
}
|
||||
|
||||
// EncodeBinary implements Serializable interface.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue