mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 23:15:16 +00:00
Fix libc-wasi/uvwasi poll/environ_get issues (#1300)
Fix libc-wasi poll_oneoff hang issue Fix libc-uvwasi environ_get sanity check issue
This commit is contained in:
parent
1ee0d90d81
commit
d955aa1bcc
|
@ -186,6 +186,9 @@ wasi_environ_get(wasm_exec_env_t exec_env, uint32 *environ_offsets,
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
if (environ_count == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
total_size = sizeof(int32) * ((uint64)environ_count + 1);
|
total_size = sizeof(int32) * ((uint64)environ_count + 1);
|
||||||
if (total_size >= UINT32_MAX
|
if (total_size >= UINT32_MAX
|
||||||
|| !validate_native_addr(environ_offsets, (uint32)total_size)
|
|| !validate_native_addr(environ_offsets, (uint32)total_size)
|
||||||
|
|
|
@ -2595,7 +2595,7 @@ wasmtime_ssp_poll_oneoff(
|
||||||
timeout = ts > INT_MAX ? -1 : (int)ts;
|
timeout = ts > INT_MAX ? -1 : (int)ts;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
timeout = -1;
|
timeout = 1000;
|
||||||
}
|
}
|
||||||
int ret = poll(pfds, nsubscriptions, timeout);
|
int ret = poll(pfds, nsubscriptions, timeout);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user