aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recv.c2
1 files changed, 1 insertions, 1 deletions
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)