mirror of
https://github.com/status-im/nim-eth.git
synced 2025-01-13 07:44:18 +00:00
Add remaining bytes check in toBytes
This commit is contained in:
parent
d2d6d7fc16
commit
f40bf032ba
@ -227,7 +227,14 @@ proc toBytes*(self: Rlp): BytesRange =
|
||||
raise newException(RlpTypeMismatch,
|
||||
"Bytes expected, but the source RLP in not a blob")
|
||||
|
||||
let payloadLen = payloadBytesCount()
|
||||
let
|
||||
payloadLen = payloadBytesCount()
|
||||
payloadOffset = payloadOffset()
|
||||
remainingBytes = bytes.len - position - payloadOffset
|
||||
|
||||
if payloadLen > remainingBytes:
|
||||
eosError()
|
||||
|
||||
if payloadLen > 0:
|
||||
let
|
||||
payloadOffset = payloadOffset()
|
||||
|
Loading…
x
Reference in New Issue
Block a user