mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-13 12:32:51 +02:00
wire: reject trailing v2 message payload data
This commit is contained in:
parent
0a33ccea29
commit
03aeb81a6f
1 changed files with 6 additions and 0 deletions
|
|
@ -570,6 +570,12 @@ func ReadV2MessageN(plaintext []byte, pver uint32, enc MessageEncoding) (
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
if buf.Len() > 0 {
|
||||
str := fmt.Sprintf("message payload has %d extra bytes "+
|
||||
"after decode", buf.Len())
|
||||
return nil, nil, messageError("ReadV2MessageN", str)
|
||||
}
|
||||
|
||||
return msg, plaintext, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue