Skip to content
  • Elias Naur's avatar
    23c6fcdb
    mobile: don't retain transient []byte in CallMsg.SetData (#14804) · 23c6fcdb
    Elias Naur authored and Péter Szilágyi's avatar Péter Szilágyi committed
    * 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
    23c6fcdb
    mobile: don't retain transient []byte in CallMsg.SetData (#14804)
    Elias Naur authored and Péter Szilágyi's avatar Péter Szilágyi committed
    * 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
Loading