mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 05:38:19 +00:00
Include a NUL byte in the message returned by wasm_trap_message().
This commit is contained in:
@@ -38,7 +38,9 @@ pub unsafe extern "C" fn wasm_trap_message(
|
||||
out: &mut wasm_byte_vec_t,
|
||||
) {
|
||||
let message = trap.inner.message();
|
||||
let byte_vec: wasm_byte_vec_t = message.into_bytes().into();
|
||||
let mut byte_vec = message.into_bytes();
|
||||
byte_vec.push(0); // append NUL
|
||||
let byte_vec: wasm_byte_vec_t = byte_vec.into();
|
||||
|
||||
out.size = byte_vec.size;
|
||||
out.data = byte_vec.data;
|
||||
|
||||
Reference in New Issue
Block a user