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 bd352daab4
commit acb1151d71

View file

@ -549,7 +549,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)