Skip to content

Commit

Permalink
capture: properly validate capture length calculated from IP headers #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaian committed Mar 1, 2023
1 parent e1d2b32 commit 038a658
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 038a658

Please sign in to comment.