Add more buffer boundary checks in wasm loader (#2734)

And fix exception not printed in `iwasm --repl` mode and resize the memory
data size to UINT32_MAX if the initial page number is 65536.
This commit is contained in:
Wenyong Huang
2023-11-09 08:42:05 +08:00
committed by GitHub
parent cc23c7ee7d
commit 7f8292ffd1
5 changed files with 22 additions and 1 deletions

View File

@ -207,8 +207,11 @@ app_instance_repl(wasm_module_inst_t module_inst)
break;
}
if (app_argc != 0) {
const char *exception;
wasm_application_execute_func(module_inst, app_argv[0],
app_argc - 1, app_argv + 1);
if ((exception = wasm_runtime_get_exception(module_inst)))
printf("%s\n", exception);
}
free(app_argv);
}

View File

@ -161,8 +161,11 @@ app_instance_repl(wasm_module_inst_t module_inst)
break;
}
if (app_argc != 0) {
const char *exception;
wasm_application_execute_func(module_inst, app_argv[0],
app_argc - 1, app_argv + 1);
if ((exception = wasm_runtime_get_exception(module_inst)))
printf("%s\n", exception);
}
free(app_argv);
}