wasm-micro-runtime/core
Callum Macmillan 8dd1c8ab86
Copy only received bytes from socket recv buffer into the app buffer (#1497)
**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
2022-09-21 06:11:03 +08:00
..
app-framework esp-idf: Make esp-idf support Libc WASI (#1356) 2022-08-15 16:17:28 +08:00
app-mgr Fix some issues reported by Coverity (#1150) 2022-05-07 16:51:43 +08:00
deps Fix littlevgl link error issues (#1006) 2022-02-15 08:41:36 +08:00
iwasm Copy only received bytes from socket recv buffer into the app buffer (#1497) 2022-09-21 06:11:03 +08:00
shared Assert on correct parameters (#1505) 2022-09-20 08:58:02 +08:00
config.h Enable remote attestation by librats in SGX mode (#1445) 2022-09-06 14:29:58 +08:00
version.h Enable the semantic version mechanism for WAMR (#1374) 2022-08-18 19:01:05 +08:00
version.h.in Enable the semantic version mechanism for WAMR (#1374) 2022-08-18 19:01:05 +08:00