Roman Khimov
1568ebc513
stackitem: rework struct cloning protection
...
Count everything, fail early, make it more compatible with
neo-project/neo-vm#423 .
2021-07-19 15:42:42 +03:00
Roman Khimov
ee4a647934
stackitem: limit EQUAL for deeply nested structs
...
See neo-project/neo-vm#428 .
2021-07-19 15:42:42 +03:00
Roman Khimov
cfe41abd35
vm: fix OOM during nested structure cloning
...
Resulting item can't have more than MaxStackSize elements. Technically this
limits to MaxStackSize cloned elements but it's considered to be enough to
mitigate the issue (the next size check is going to happen during push to the
stack). See neo-project/neo#2534 , thanks @vang1ong7ang.
2021-07-11 18:47:50 +03:00
Evgenii Stratonikov
96bca91e4b
vm: handle very big int creation properly
...
Determine size as in reference implementation instead of
`big.Int.BitLen()`
Close #1437 .
2020-10-07 11:50:42 +03:00
Anna Shaleva
1f9b92c295
vm: restrict comparable ByteArray length
...
MaxByteArrayComparableSize should equals to 65535.
2020-09-29 10:42:01 +03:00
Evgenii Stratonikov
b8cc33d0b2
stackitem: implement DeepCopy
2020-08-05 11:19:41 +03:00
Evgenii Stratonikov
b53f0257f5
stackitem: change ByteArray type to ByteString
...
Adjust only string representation.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-07-31 16:07:16 +03:00
Evgenii Stratonikov
9252ef65bb
vm: make EQUAL type strict
...
Do not perform type conversions when comparing elements.
2020-07-23 13:01:43 +03:00
Anna Shaleva
783f5ecb01
vm: move StackItem to a separate package
...
closes #912
2020-06-08 13:27:08 +03:00