mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-04-18 18:18:44 +00:00
Check integer overflow for wasm_runtime_wasi_nn_registry_set_args
This commit is contained in:
parent
b12245198e
commit
a85079a2aa
|
|
@ -1812,6 +1812,11 @@ wasm_runtime_wasi_nn_registry_set_args(WASINNRegistry *registry,
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((sizeof(uint32_t *) * n_graphs) >= UINT32_MAX) {
|
||||
LOG_ERROR("Invalid size for wasm_runtime_malloc.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
registry->n_graphs = n_graphs;
|
||||
registry->target = (uint32_t **)wasm_runtime_malloc(sizeof(uint32_t *) * n_graphs);
|
||||
registry->encoding = (uint32_t **)wasm_runtime_malloc(sizeof(uint32_t *) * n_graphs);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user