vm: copy slice in (*ByteArrayItem).TryBytes()

This commit is contained in:
Evgenii Stratonikov 2020-05-20 12:02:06 +03:00
parent d6e4c506b6
commit 8f5f6fba07

View file

@ -517,7 +517,9 @@ func (i *ByteArrayItem) Bool() bool {
// TryBytes implements StackItem interface.
func (i *ByteArrayItem) TryBytes() ([]byte, error) {
return i.value, nil
val := make([]byte, len(i.value))
copy(val, i.value)
return val, nil
}
// TryInteger implements StackItem interface.