tcp: don't store negative length payloads for assembly #187

This commit is contained in:
Kaian 2017-05-15 18:05:16 +02:00
parent 60d98b3316
commit 35eca717b8
1 changed files with 1 additions and 1 deletions

View File

@ -600,7 +600,7 @@ capture_packet_reasm_tcp(capture_info_t *capinfo, packet_t *packet, struct tcphd
// We have a full SIP Packet, but do not remove everything from the reasm queue
packet_t *cont = packet_clone(pkt);
int pldiff = original_size - pkt->payload_len;
if (pldiff < MAX_CAPTURE_LEN) {
if (pldiff > 0 && pldiff < MAX_CAPTURE_LEN) {
packet_set_payload(cont, full_payload + pkt->payload_len, pldiff);
vector_append(capinfo->tcp_reasm, cont);
}