transaction: fix maxSubitems handling in JSON scope unmarshaller

Notice that binary deserializer (readArrayOfConditions) does it correctly. Can
be checked with neo-project/neo#2720 case.
This commit is contained in:
Roman Khimov 2022-05-06 10:20:55 +03:00
parent c410219cba
commit 7dc0404306

View file

@ -491,7 +491,7 @@ func unmarshalArrayOfConditionJSONs(arr []json.RawMessage, maxDepth int) ([]Witn
if l == 0 {
return nil, errors.New("empty array of conditions")
}
if l >= maxSubitems {
if l > maxSubitems {
return nil, errors.New("too many elements")
}
res := make([]WitnessCondition, l)