forked from Mirrors/sngrep
Avoid reassembly of packets bigger than 20Kb
This commit is contained in:
parent
7a713e8c1e
commit
02ad96f987
|
@ -229,6 +229,13 @@ capture_packet_reasm_tcp(capture_packet_t *packet, struct tcphdr *tcp, u_char *p
|
||||||
// Set initial payload
|
// Set initial payload
|
||||||
capture_packet_set_payload(pkt, payload, size_payload);
|
capture_packet_set_payload(pkt, payload, size_payload);
|
||||||
} else {
|
} else {
|
||||||
|
// Check payload length. Dont handle too big payload packets
|
||||||
|
if (pkt->payload_len + size_payload > MAX_CAPTURE_LEN) {
|
||||||
|
capture_packet_destroy(pkt);
|
||||||
|
vector_remove(capture_cfg.tcp_reasm, pkt);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Append payload to the existing
|
// Append payload to the existing
|
||||||
new_payload = sng_malloc(pkt->payload_len + size_payload);
|
new_payload = sng_malloc(pkt->payload_len + size_payload);
|
||||||
memcpy(new_payload, pkt->payload, pkt->payload_len);
|
memcpy(new_payload, pkt->payload, pkt->payload_len);
|
||||||
|
|
Loading…
Reference in New Issue