mobile: don't retain transient []byte in CallMsg.SetData (#14804)
* mobile: don't retain transient []byte in CallMsg.SetData Go mobile doesn't copy []byte parameters, for performance and to allow writes to the byte array be reflected in the native byte array. Unfortunately, that means []byte arguments are only valid during the call it is being passed into. CallMsg.SetData retains such a byte array. Copy it instead Fixes #14675 * mobile: copy all []byte arguments from gomobile To avoid subtle errors when accidentially retaining an otherwise transient byte slice coming from gomobile, copy all byte slices before use. * mobile: replace copySlice with common.CopyBytes
Showing
- mobile/accounts.go 6 additions, 5 deletionsmobile/accounts.go
- mobile/big.go 3 additions, 1 deletionmobile/big.go
- mobile/bind.go 1 addition, 1 deletionmobile/bind.go
- mobile/common.go 2 additions, 2 deletionsmobile/common.go
- mobile/ethereum.go 1 addition, 1 deletionmobile/ethereum.go
- mobile/interface.go 1 addition, 1 deletionmobile/interface.go
- mobile/types.go 7 additions, 6 deletionsmobile/types.go
Loading
Please register or sign in to comment