mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-06-18 02:59:21 +00:00
wasi_nn_openvino.c: add a missing buffer overflow check in get_output (#4353)
cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4351
This commit is contained in:
parent
20be1d33fe
commit
2f0750a6fe
|
@ -439,6 +439,11 @@ get_output(void *ctx, graph_execution_context exec_ctx, uint32_t index,
|
|||
|
||||
CHECK_OV_STATUS(ov_tensor_get_byte_size(ov_tensor, &byte_size), ret);
|
||||
|
||||
if (byte_size > *output_tensor_size) {
|
||||
ret = too_large;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
CHECK_OV_STATUS(ov_tensor_data(ov_tensor, &data), ret);
|
||||
|
||||
memcpy(output_tensor, data, byte_size);
|
||||
|
|
Loading…
Reference in New Issue
Block a user