capture: properly validate capture length calculated from IP headers #430

This commit is contained in:
Kaian 2023-03-01 12:55:10 +01:00
parent e1d2b322ac
commit 038a658835
1 changed files with 4 additions and 0 deletions

View File

@ -616,6 +616,10 @@ capture_packet_reasm_ip(capture_info_t *capinfo, const struct pcap_pkthdr *heade
}
}
// Check maximum capture len
if (*caplen > MAX_CAPTURE_LEN)
return NULL;
// If no fragmentation
if (ip_frag == 0) {
// Just create a new packet with given network data