Compare commits

...

3 Commits

Author SHA1 Message Date
Zhenwei Jin
54b20ac285
Merge 3ffc82b1f6 into 17be90d8f0 2025-07-11 11:05:56 +08:00
YAMAMOTO Takashi
17be90d8f0
posix os_socket_addr_resolve: return the consistent max_info_size (#4467)
Some checks failed
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $FAST_INTERP_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_iwasm (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, -DWAMR_DISABLE_HW_BOUND_CHECK=1, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13, darwin) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $AOT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $CLASSIC_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_INTERP_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $FAST_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_EAGER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $LLVM_LAZY_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_wasm_c_api (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, $MULTI_TIER_JIT_BUILD_OPTIONS, macos-13) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_arm_macos.outputs.cache_key }}, macos-14) (push) Has been cancelled
compilation on macos / build_samples_others (${{ needs.build_llvm_libraries_on_intel_macos.outputs.cache_key }}, macos-13) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $AOT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $CLASSIC_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_INTERP_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / run_samples_file (-DWAMR_BUILD_SGX_IPFS=1, $FAST_JIT_BUILD_OPTIONS, ${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, linux-sgx) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $SIMD_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, aot, $XIP_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on SGX / spec_test_default (${{ needs.build_llvm_libraries.outputs.cache_key }}, ubuntu-22.04, fast-jit, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / build_wamrc (${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}, windows-latest) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (classic-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $DEFAULT_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $MULTI_MODULES_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $THREADS_TEST_OPTIONS) (push) Has been cancelled
compilation on windows-latest / test (fast-interp, $WASI_TEST_OPTIONS) (push) Has been cancelled
return the same value for max_info_size regardless of addr_info_size.
2025-07-10 13:42:57 +08:00
zhenweijin
3ffc82b1f6 add validation for recursive type count in loader 2025-07-07 13:34:08 +08:00
2 changed files with 31 additions and 18 deletions

View File

@ -400,7 +400,8 @@ check_array_type(const WASMModule *module, uint32 type_index, char *error_buf,
error_buf_size)) {
return false;
}
if (module->types[type_index]->type_flag != WASM_TYPE_ARRAY) {
if (module->types[type_index] == NULL
|| module->types[type_index]->type_flag != WASM_TYPE_ARRAY) {
set_error_buf(error_buf, error_buf_size, "unknown array type");
return false;
}
@ -423,7 +424,8 @@ check_function_type(const WASMModule *module, uint32 type_index,
}
#if WASM_ENABLE_GC != 0
if (module->types[type_index]->type_flag != WASM_TYPE_FUNC) {
if (module->types[type_index] == NULL
|| module->types[type_index]->type_flag != WASM_TYPE_FUNC) {
set_error_buf(error_buf, error_buf_size, "unknown function type");
return false;
}
@ -1255,8 +1257,9 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
error_buf_size)) {
goto fail;
}
if (module->types[type_idx]->type_flag
!= WASM_TYPE_STRUCT) {
if (module->types[type_idx] == NULL
|| module->types[type_idx]->type_flag
!= WASM_TYPE_STRUCT) {
set_error_buf(error_buf, error_buf_size,
"unknown struct type");
goto fail;
@ -2303,9 +2306,14 @@ load_type_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
total_size = new_total_size;
}
LOG_VERBOSE("Processing rec group [%d-%d]",
processed_type_count,
processed_type_count + rec_count - 1);
if (rec_count < 1) {
LOG_VERBOSE("Processing 0-entry rec group");
}
else {
LOG_VERBOSE("Processing rec group [%d-%d]",
processed_type_count,
processed_type_count + rec_count - 1);
}
}
else {
p--;
@ -12677,7 +12685,9 @@ re_scan:
error_buf, error_buf_size)) {
goto fail;
}
if (module->types[type_idx1]->type_flag != WASM_TYPE_FUNC) {
if (module->types[type_idx1] == NULL
|| module->types[type_idx1]->type_flag
!= WASM_TYPE_FUNC) {
set_error_buf(error_buf, error_buf_size,
"unknown function type");
goto fail;
@ -12694,7 +12704,9 @@ re_scan:
error_buf, error_buf_size)) {
goto fail;
}
if (module->types[type_idx]->type_flag != WASM_TYPE_FUNC) {
if (module->types[type_idx] == NULL
|| module->types[type_idx]->type_flag
!= WASM_TYPE_FUNC) {
set_error_buf(error_buf, error_buf_size,
"unknown function type");
goto fail;
@ -14533,8 +14545,9 @@ re_scan:
error_buf_size)) {
goto fail;
}
if (module->types[type_idx]->type_flag
!= WASM_TYPE_STRUCT) {
if (module->types[type_idx] == NULL
|| module->types[type_idx]->type_flag
!= WASM_TYPE_STRUCT) {
set_error_buf(error_buf, error_buf_size,
"unknown struct type");
goto fail;
@ -14620,8 +14633,9 @@ re_scan:
error_buf_size)) {
goto fail;
}
if (module->types[type_idx]->type_flag
!= WASM_TYPE_STRUCT) {
if (module->types[type_idx] == NULL
|| module->types[type_idx]->type_flag
!= WASM_TYPE_STRUCT) {
set_error_buf(error_buf, error_buf_size,
"unknown struct type");
goto fail;

View File

@ -406,12 +406,11 @@ os_socket_addr_resolve(const char *host, const char *service,
res = result;
while (res) {
if (!is_addrinfo_supported(res)) {
res = res->ai_next;
continue;
}
if (addr_info_size > pos) {
if (!is_addrinfo_supported(res)) {
res = res->ai_next;
continue;
}
ret =
sockaddr_to_bh_sockaddr(res->ai_addr, &addr_info[pos].sockaddr);