summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcap_mm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap_mm.c b/pcap_mm.c
index 486fbfe..0c4114e 100644
--- a/pcap_mm.c
+++ b/pcap_mm.c
@@ -69,14 +69,14 @@ static ssize_t pcap_mm_read(int fd __maybe_unused, pcap_pkthdr_t *phdr,
{
size_t hdrsize = pcap_get_hdr_length(phdr, type), hdrlen;
- if (unlikely((off_t) (ptr_va_curr + hdrsize - ptr_va_start) > map_size))
+ if (unlikely((off_t) (ptr_va_curr + hdrsize - ptr_va_start) > (off_t) map_size))
return -EIO;
fmemcpy(&phdr->raw, ptr_va_curr, hdrsize);
ptr_va_curr += hdrsize;
hdrlen = pcap_get_length(phdr, type);
- if (unlikely((off_t) (ptr_va_curr + hdrlen - ptr_va_start) > map_size))
+ if (unlikely((off_t) (ptr_va_curr + hdrlen - ptr_va_start) > (off_t) map_size))
return -EIO;
if (unlikely(hdrlen == 0 || hdrlen > len))
return -EINVAL;