mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +00:00
vm: allow custom limit duing Map\Array\Struct deserialization
This commit is contained in:
parent
15fa65d30f
commit
25ed5fcd60
1 changed files with 2 additions and 2 deletions
|
@ -304,7 +304,7 @@ func (r *deserContext) decodeBinary() Item {
|
|||
return NewBigInteger(num)
|
||||
case ArrayT, StructT:
|
||||
size := int(r.ReadVarUint())
|
||||
if size > MaxDeserialized {
|
||||
if size > r.limit {
|
||||
r.Err = errTooBigElements
|
||||
return nil
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ func (r *deserContext) decodeBinary() Item {
|
|||
return NewStruct(arr)
|
||||
case MapT:
|
||||
size := int(r.ReadVarUint())
|
||||
if size > MaxDeserialized {
|
||||
if size > r.limit/2 {
|
||||
r.Err = errTooBigElements
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue