wamr_sys

Function wasm_runtime_validate_app_str_addr

Source
pub unsafe extern "C" fn wasm_runtime_validate_app_str_addr(
    module_inst: wasm_module_inst_t,
    app_str_offset: u64,
) -> bool
Expand description

Similar to wasm_runtime_validate_app_addr(), except that the size parameter is not provided. This function validates the app string address, check whether it belongs to WASM module instance’s address space, or in its heap space or memory space. Moreover, it checks whether it is the offset of a string that is end with ‘\0’.

Note: The validation result, especially the NUL termination check, is not reliable for a module instance with multiple threads because other threads can modify the heap behind us.

@param module_inst the WASM module instance @param app_str_offset the app address of the string to validate, which is a relative address

@return true if success, false otherwise. If failed, an exception will be thrown.