Skip to content

Commit 10980a1

Browse files
authored
Fix app manager parse applet name issue (#280)
1 parent 7a287fd commit 10980a1

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

core/app-mgr/app-manager/app_manager_host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int aee_host_msg_callback(void *msg, uint16_t msg_len)
216216

217217
am_dispatch_request(&request);
218218
} else {
219-
printf("unexpected host msg type: %d\n", msg_type);
219+
app_manager_printf("unexpected host msg type: %d\n", msg_type);
220220
}
221221

222222
APP_MGR_FREE(recv_ctx.message.payload);

core/app-mgr/app-manager/resource_reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void targeted_app_request_handler(request_t *request, void *unused)
7171
}
7272

7373
strncpy(applet_name, request->url + offset, sizeof(applet_name) - 1);
74-
char *p = strrchr(applet_name, '/');
74+
char *p = strchr(applet_name, '/');
7575
if (p) {
7676
*p = 0;
7777
} else

core/iwasm/interpreter/wasm_loader.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,8 @@ load_table_segment_section(const uint8 *buf, const uint8 *buf_end, WASMModule *m
20602060
}
20612061
for (j = 0; j < function_count; j++) {
20622062
read_leb_uint32(p, p_end, function_index);
2063-
if (function_index >= module->function_count + module->function_count) {
2063+
if (function_index >= module->import_function_count
2064+
+ module->function_count) {
20642065
set_error_buf(error_buf, error_buf_size,
20652066
"Load table segment section failed: "
20662067
"unknown function");

core/iwasm/interpreter/wasm_mini_loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ load_table_segment_section(const uint8 *buf, const uint8 *buf_end, WASMModule *m
12091209

12101210
for (j = 0; j < function_count; j++) {
12111211
read_leb_uint32(p, p_end, function_index);
1212-
bh_assert(function_index < module->function_count
1212+
bh_assert(function_index < module->import_function_count
12131213
+ module->function_count);
12141214
table_segment->func_indexes[j] = function_index;
12151215
}

0 commit comments

Comments
 (0)