From 2eadb117cec40da4bbcbc80281a1b071be540f0c Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Mon, 16 Nov 2026 14:21:19 +0100 Subject: Fix assert() in tcp_vu_sock_recv() In tcp_vu_sock_recv(), iov_tail_clone() can copy up to ARRAY_SIZE(iov_msg) - j entries so the assert must allow ARRAY_SIZE(iov_msg) - j as valid a value. Reported-by: Johannes Bartunek Signed-off-by: Laurent Vivier Signed-off-by: Stefano Brivio --- tcp_vu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp_vu.c b/tcp_vu.c index 868a35b..c83abd6 100644 --- a/tcp_vu.c +++ b/tcp_vu.c @@ -291,7 +291,7 @@ static ssize_t tcp_vu_sock_recv(const struct ctx *c, struct vu_virtq *vq, cnt = iov_tail_clone(&iov_msg[j], ARRAY_SIZE(iov_msg) - j, &data); - assert(cnt < ARRAY_SIZE(iov_msg) - j); + assert(cnt <= ARRAY_SIZE(iov_msg) - j); if (cnt < 0) die("Missing entries in iov_msg"); -- cgit v1.2.3