From 4efb424352d94a8b1aa638618f3d19c7f8dc575a Mon Sep 17 00:00:00 2001 From: Andrei Tatar Date: Thu, 6 Feb 2025 14:05:37 +0100 Subject: [PATCH] sockets.c: Use size_t for iovec length This change updates the lwip socket read/write ops to use unsigned size_t for the length of the passed-in iovec. The internal lwip read/write functions still use int, and simply package it into struct msghdr, which is size_t once again. If overflow is a concern we should fix it with a build patch. Signed-off-by: Andrei Tatar Reviewed-by: Sergiu Moga Approved-by: Razvan Deaconescu GitHub-Closes: #61 --- sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sockets.c b/sockets.c index f82da50..7eb0af1 100644 --- a/sockets.c +++ b/sockets.c @@ -343,7 +343,7 @@ lwip_posix_socket_sendto(posix_sock *file, const void *buf, static ssize_t lwip_posix_socket_read(posix_sock *file, const struct iovec *iov, - int iovcnt) + size_t iovcnt) { int lwip_fd; ssize_t ret; @@ -360,7 +360,7 @@ lwip_posix_socket_read(posix_sock *file, const struct iovec *iov, static ssize_t lwip_posix_socket_write(posix_sock *file, const struct iovec *iov, - int iovcnt) + size_t iovcnt) { int lwip_fd; ssize_t ret; -- 2.39.5