]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-snit.c
Make sure no read routine process more than INT_MAX packets.
[libpcap] / pcap-snit.c
index ca6222cf01666aac7d185a281ff6dac6eaf146e0..ff0cb59a43dc2fca7b7beec7b9ca31977150d349 100644 (file)
@@ -139,6 +139,9 @@ pcap_read_snit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 
        /*
         * loop through each snapshot in the chunk
+        *
+        * This assumes that a single buffer of packets will have
+        * <= INT_MAX packets, so the packet count doesn't overflow.
         */
        n = 0;
        ep = bp + cc;