diff options
author | Mattias Andrée <maandree@kth.se> | 2021-12-10 19:48:10 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-12-10 19:48:10 +0100 |
commit | 523ff19d1f6b9f14358b91e3191f2e8262a66dec (patch) | |
tree | 890cc0db4a7f26400d13ba2fccc06ad1901c2fce /recv.c | |
parent | m + Add liberror_recv_require and liberror_recv_short (diff) | |
download | liberror-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |