mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-12-10 00:04:16 +00:00
**What** * Updated `copy_buffer_to_iovec_app` so that it copies as much of the buffer into the iovec as specified * Throw invalid value when allocating an iovec of size 0 **Why** * A bug found from TCP client example which allocates 1024 for the iovec size (where the buf size is also 1024) but received bytes is passed in as the `buf_size` argument to `copy_buffer_to_iovec_app`. This would return early after hitting this check `buf + data->buf_len > buf_begin + buf_size`. However, if the amount to copy is less than the iovec size, we should copy that much of the buf size. Eg TCP client sample receives 27(?) bytes at a time, and this copies 27 bytes into the iovec of size 1024 * The TCP client example attempts to recv bytes of size 0, this attempts to wasm malloc size 0, which outputs a warning. We should early return if recv bytes of size 0 |
||
|---|---|---|
| .. | ||
| debug-engine | ||
| lib-pthread | ||
| lib-rats | ||
| lib-socket | ||
| libc-builtin | ||
| libc-emcc | ||
| libc-uvwasi | ||
| libc-wasi | ||
| thread-mgr | ||