]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-bpf.c
Make sure no read routine process more than INT_MAX packets.
[libpcap] / pcap-bpf.c
index 836e7d00c51569c61486ef094eb2e03c732f4ca8..c9967ee0851285ba3aac3465cb4ecd37fc9e02ac 100644 (file)
@@ -1177,6 +1177,9 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 
        /*
         * Loop through each packet.
+        *
+        * This assumes that a single buffer of packets will have
+        * <= INT_MAX packets, so the packet count doesn't overflow.
         */
 #ifdef BIOCSTSTAMP
 #define bhp ((struct bpf_xhdr *)bp)