Merge pull request #1902 from nspcc-dev/ignore-nonnumeric-values-in-nep17-transfers

core: ignore non-numeric "amounts" in Transfer events
This commit is contained in:
Roman Khimov 2021-04-12 17:05:13 +03:00 committed by GitHub
commit a642bc6bc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -912,6 +912,9 @@ func (bc *Blockchain) handleNotification(note *state.NotificationEvent, d *dao.C
if !ok { if !ok {
return return
} }
if len(bs) > bigint.MaxBytesLen {
return // Not a proper number.
}
amount = bigint.FromBytes(bs) amount = bigint.FromBytes(bs)
} }
bc.processNEP17Transfer(d, h, b, note.ScriptHash, from, to, amount) bc.processNEP17Transfer(d, h, b, note.ScriptHash, from, to, amount)