lnwire: check length of payload in decodeShortChanIDs
This commit is contained in:
parent
c5979c7d80
commit
f7436f43b2
@ -112,6 +112,10 @@ func decodeShortChanIDs(r io.Reader) (ShortChanIDEncoding, []ShortChannelID, err
|
|||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if numBytesResp == 0 {
|
||||||
|
return 0, nil, fmt.Errorf("No encoding type specified")
|
||||||
|
}
|
||||||
|
|
||||||
queryBody := make([]byte, numBytesResp)
|
queryBody := make([]byte, numBytesResp)
|
||||||
if _, err := io.ReadFull(r, queryBody); err != nil {
|
if _, err := io.ReadFull(r, queryBody); err != nil {
|
||||||
return 0, nil, err
|
return 0, nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user