From 5b6d5e78de106503b3b9add218bb3d2b1d63c493 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 10 Nov 2022 11:35:14 -0600 Subject: [PATCH] Merge pull request from GHSA-h84q-m8rr-3v9q The Rust definition was previously performing a 4-byte write when the C API was declared as taking an 1-byte buffer. --- crates/c-api/src/trap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/c-api/src/trap.rs b/crates/c-api/src/trap.rs index 55beff0629..479f30f430 100644 --- a/crates/c-api/src/trap.rs +++ b/crates/c-api/src/trap.rs @@ -116,7 +116,7 @@ pub(crate) fn error_trace<'a>(error: &'a Error, out: &mut wasm_frame_vec_t<'a>) } #[no_mangle] -pub extern "C" fn wasmtime_trap_code(raw: &wasm_trap_t, code: &mut i32) -> bool { +pub extern "C" fn wasmtime_trap_code(raw: &wasm_trap_t, code: &mut u8) -> bool { let trap = match raw.error.downcast_ref::() { Some(trap) => trap, None => return false,