Fix some issues reported by klocwork (#1233)

Change memcpy to bh_memcpy_s and add some asserts to
enhance the security.
This commit is contained in:
Xu Jun
2022-06-16 19:50:47 +08:00
committed by GitHub
parent 188d5e70e9
commit 4b38205023
6 changed files with 38 additions and 22 deletions

View File

@ -374,6 +374,8 @@ send_thread_stop_status(WASMGDBServer *server, uint32 status, korp_tid tid)
exec_env = wasm_debug_instance_get_current_env(
(WASMDebugInstance *)server->thread->debug_instance);
bh_assert(exec_env);
exception =
wasm_runtime_get_exception(wasm_runtime_get_module_inst(exec_env));
if (exception) {