multi: update to tlv/v1.1.0 and use new *P2P tlv decoding variants
This changes the call-sites in several places to use the *P2P variants to not trigger an OOM on untrusted input. This makes the code safe with the new tlv version. Note that the call-sites prior to this change were also safe.
This commit is contained in:
5 files changed
+13
-6
No files matched your search
@@ -139,7 +139,9 @@ func NewPayloadFromReader(r io.Reader) (*Payload, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parsedTypes, err := tlvStream.DecodeWithParsedTypes(r)
|
||||
// Since this data is provided by a potentially malicious peer, pass it
|
||||
// into the P2P decoding variant.
|
||||
parsedTypes, err := tlvStream.DecodeWithParsedTypesP2P(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user