From 523ff19d1f6b9f14358b91e3191f2e8262a66dec Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 10 Dec 2021 19:48:10 +0100 Subject: recv: fix types in check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recv.c b/recv.c index 549a9f2..7d1af35 100644 --- a/recv.c +++ b/recv.c @@ -152,7 +152,7 @@ ssize_t liberror_recv_require(int fd, void *buf, size_t n, int flags, size_t min, size_t max, const char *fname) { ssize_t r = recv(fd, buf, n, flags); - if (r >= min && r <= max) + if (r >= 0 && (size_t)r >= min && (size_t)r <= max) return r; liberror_save_backtrace(NULL); if (r < 0) -- cgit v1.2.3-70-g09d2