diff --git a/core/app-mgr/app-manager/app_manager_host.c b/core/app-mgr/app-manager/app_manager_host.c index d9024a346..a6b13baac 100644 --- a/core/app-mgr/app-manager/app_manager_host.c +++ b/core/app-mgr/app-manager/app_manager_host.c @@ -216,7 +216,7 @@ int aee_host_msg_callback(void *msg, uint16_t msg_len) am_dispatch_request(&request); } else { - printf("unexpected host msg type: %d\n", msg_type); + app_manager_printf("unexpected host msg type: %d\n", msg_type); } APP_MGR_FREE(recv_ctx.message.payload); diff --git a/core/app-mgr/app-manager/resource_reg.c b/core/app-mgr/app-manager/resource_reg.c index c6655ff65..83bc37d98 100644 --- a/core/app-mgr/app-manager/resource_reg.c +++ b/core/app-mgr/app-manager/resource_reg.c @@ -71,7 +71,7 @@ void targeted_app_request_handler(request_t *request, void *unused) } strncpy(applet_name, request->url + offset, sizeof(applet_name) - 1); - char *p = strrchr(applet_name, '/'); + char *p = strchr(applet_name, '/'); if (p) { *p = 0; } else diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index 042a503ed..34400822b 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -2060,7 +2060,8 @@ load_table_segment_section(const uint8 *buf, const uint8 *buf_end, WASMModule *m } for (j = 0; j < function_count; j++) { read_leb_uint32(p, p_end, function_index); - if (function_index >= module->function_count + module->function_count) { + if (function_index >= module->import_function_count + + module->function_count) { set_error_buf(error_buf, error_buf_size, "Load table segment section failed: " "unknown function"); diff --git a/core/iwasm/interpreter/wasm_mini_loader.c b/core/iwasm/interpreter/wasm_mini_loader.c index 3ca23f818..00299f7c7 100644 --- a/core/iwasm/interpreter/wasm_mini_loader.c +++ b/core/iwasm/interpreter/wasm_mini_loader.c @@ -1209,7 +1209,7 @@ load_table_segment_section(const uint8 *buf, const uint8 *buf_end, WASMModule *m for (j = 0; j < function_count; j++) { read_leb_uint32(p, p_end, function_index); - bh_assert(function_index < module->function_count + bh_assert(function_index < module->import_function_count + module->function_count); table_segment->func_indexes[j] = function_index; }