aboutsummaryrefslogtreecommitdiffstats
path: root/recv.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-12-10 19:48:10 +0100
committerMattias Andrée <maandree@kth.se>2021-12-10 19:48:10 +0100
commit523ff19d1f6b9f14358b91e3191f2e8262a66dec (patch)
tree890cc0db4a7f26400d13ba2fccc06ad1901c2fce /recv.c
parentm + Add liberror_recv_require and liberror_recv_short (diff)
downloadliberror-libc-523ff19d1f6b9f14358b91e3191f2e8262a66dec.tar.gz
liberror-libc-523ff19d1f6b9f14358b91e3191f2e8262a66dec.tar.bz2
liberror-libc-523ff19d1f6b9f14358b91e3191f2e8262a66dec.tar.xz
recv: fix types in check
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'recv.c')
-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)