state: reject too big transfers, fix #1900

This commit is contained in:
Roman Khimov 2021-04-12 12:14:33 +03:00
parent 663f10192f
commit 1202494479

View file

@ -188,6 +188,9 @@ func NEP5TransferFromNotification(ne NotificationEvent, txHash util.Uint256, hei
if !ok {
return nil, errors.New("wrong amount type")
}
if len(bs) > amountSize {
return nil, errors.New("integer overflow")
}
amount = emit.BytesToInt(bs)
}
toAddr := parseUint160(to)