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 { switch t {
case ByteArrayT, BufferT: case ByteArrayT, BufferT:
data := r.ReadVarBytes() data := r.ReadVarBytes(MaxSize)
return NewByteArray(data) return NewByteArray(data)
case BooleanT: case BooleanT:
var b = r.ReadBool() var b = r.ReadBool()