vm: copy slice in (*ByteArrayItem).TryBytes()
This commit is contained in:
parent
d6e4c506b6
commit
8f5f6fba07
1 changed files with 3 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue