stackitem: limit buffer/bytearray reads upon deserialization

This is not the way it's done in C#, but that's the most sensible approach to
me.
This commit is contained in:
Roman Khimov 2020-10-07 23:08:20 +03:00
parent 64e9775707
commit 0120a8f239

View file

@ -98,7 +98,7 @@ func DecodeBinaryStackItem(r *io.BinReader) Item {
switch t {
case ByteArrayT, BufferT:
data := r.ReadVarBytes()
data := r.ReadVarBytes(MaxSize)
return NewByteArray(data)
case BooleanT:
var b = r.ReadBool()