]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-dag.c
Make sure no read routine process more than INT_MAX packets.
[libpcap] / pcap-dag.c
index b207dd84cebab024db0a0d1c8403c391b228ad38..b3949d53e0c44b6aaeac096859cc6192be747720 100644 (file)
@@ -391,7 +391,12 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 
        }
 
-       /* Process the packets. */
+       /*
+        * Process the packets.
+        *
+        * This assumes that a single buffer of packets will have
+        * <= INT_MAX packets, so the packet count doesn't overflow.
+        */
        while (pd->dag_mem_top - pd->dag_mem_bottom >= dag_record_size) {
 
                unsigned short packet_len = 0;