Merge pull request #952 from lnslbrty/fix/missing-lengthcheck-in-reader-uutil

Fixed heap overflow caused by missing lengthcheck in reader uutil.
This commit is contained in:
Luca Deri
2020-07-07 14:42:20 +02:00
committed by GitHub
+1 -1
View File
@@ -1719,7 +1719,7 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
workflow->stats.mpls_count++;
type = ETH_P_IP, ip_offset += 4;
while(!mpls.mpls.s) {
while(!mpls.mpls.s && (((bpf_u_int32)ip_offset) + 4 < header->caplen)) {
mpls.u32 = *((uint32_t *) &packet[ip_offset]);
mpls.u32 = ntohl(mpls.u32);
ip_offset += 4;