Skip to content

Commit 4efb424

Browse files
andreittrrazvand
authored andcommitted
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 <[email protected]> Reviewed-by: Sergiu Moga <[email protected]> Approved-by: Razvan Deaconescu <[email protected]> GitHub-Closes: #61
1 parent 70a2721 commit 4efb424

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sockets.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ lwip_posix_socket_sendto(posix_sock *file, const void *buf,
343343

344344
static ssize_t
345345
lwip_posix_socket_read(posix_sock *file, const struct iovec *iov,
346-
int iovcnt)
346+
size_t iovcnt)
347347
{
348348
int lwip_fd;
349349
ssize_t ret;
@@ -360,7 +360,7 @@ lwip_posix_socket_read(posix_sock *file, const struct iovec *iov,
360360

361361
static ssize_t
362362
lwip_posix_socket_write(posix_sock *file, const struct iovec *iov,
363-
int iovcnt)
363+
size_t iovcnt)
364364
{
365365
int lwip_fd;
366366
ssize_t ret;

0 commit comments

Comments
 (0)