summaryrefslogtreecommitdiff
path: root/libhw/host_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhw/host_net.c')
-rw-r--r--libhw/host_net.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libhw/host_net.c b/libhw/host_net.c
index 505c7dc..eee293e 100644
--- a/libhw/host_net.c
+++ b/libhw/host_net.c
@@ -229,6 +229,9 @@ static void *hostnet_pthread_read(void *_args) {
static ssize_t hostnet_tcp_read(struct _hostnet_tcp_conn *conn, void *buf, size_t count) {
assert(conn);
+ assert(count == 0 || buf);
+ if (count == 0)
+ return 0;
ssize_t ret;
struct hostnet_pthread_read_args args = {
@@ -287,6 +290,9 @@ static void *hostnet_pthread_write(void *_args) {
static ssize_t hostnet_tcp_write(struct _hostnet_tcp_conn *conn, void *buf, size_t count) {
assert(conn);
+ assert(count == 0 || buf);
+ if (count == 0)
+ return 0;
ssize_t ret;
struct hostnet_pthread_write_args args = {