lnwire: check length of payload in decodeShortChanIDs

This commit is contained in:
Olaoluwa Osuntokun 2018-09-13 15:56:21 -07:00
parent c5979c7d80
commit f7436f43b2
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -112,6 +112,10 @@ func decodeShortChanIDs(r io.Reader) (ShortChanIDEncoding, []ShortChannelID, err
return 0, nil, err
}
if numBytesResp == 0 {
return 0, nil, fmt.Errorf("No encoding type specified")
}
queryBody := make([]byte, numBytesResp)
if _, err := io.ReadFull(r, queryBody); err != nil {
return 0, nil, err