mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-02-16 21:16:30 +00:00
Merge pull request #3185 from nspcc-dev/fix-stackitem-limits
vm: reduce maximum stckitem size
This commit is contained in:
commit
de2a445088
2 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ const (
|
||||||
// MaxBigIntegerSizeBits is the maximum size of a BigInt item in bits.
|
// MaxBigIntegerSizeBits is the maximum size of a BigInt item in bits.
|
||||||
MaxBigIntegerSizeBits = 32 * 8
|
MaxBigIntegerSizeBits = 32 * 8
|
||||||
// MaxSize is the maximum item size allowed in the VM.
|
// MaxSize is the maximum item size allowed in the VM.
|
||||||
MaxSize = 1024 * 1024
|
MaxSize = math.MaxUint16 * 2
|
||||||
// MaxComparableNumOfItems is the maximum number of items that can be compared for structs.
|
// MaxComparableNumOfItems is the maximum number of items that can be compared for structs.
|
||||||
MaxComparableNumOfItems = MaxDeserialized
|
MaxComparableNumOfItems = MaxDeserialized
|
||||||
// MaxClonableNumOfItems is the maximum number of items that can be cloned in structs.
|
// MaxClonableNumOfItems is the maximum number of items that can be cloned in structs.
|
||||||
|
|
|
@ -383,7 +383,7 @@ func TestToJSONWithTypesBadCases(t *testing.T) {
|
||||||
// until the necessary branch is covered #ididthemath.
|
// until the necessary branch is covered #ididthemath.
|
||||||
arr := NewArray([]Item{
|
arr := NewArray([]Item{
|
||||||
NewByteArray(bigBuf[:MaxSize/4*3-70]),
|
NewByteArray(bigBuf[:MaxSize/4*3-70]),
|
||||||
NewBigInteger(big.NewInt(1234)),
|
NewBigInteger(big.NewInt(123456)),
|
||||||
})
|
})
|
||||||
_, err := ToJSONWithTypes(arr)
|
_, err := ToJSONWithTypes(arr)
|
||||||
require.ErrorIs(t, err, errTooBigSize)
|
require.ErrorIs(t, err, errTooBigSize)
|
||||||
|
|
Loading…
Add table
Reference in a new issue