Checks enough data for UDP header

This commit is contained in:
Philippe Antoine
2020-03-19 16:44:53 +01:00
parent b2cbe76e71
commit e9195589d2
-2
View File
@@ -1709,10 +1709,8 @@ ether_type_check:
}
if(workflow->prefs.decode_tunnels && (proto == IPPROTO_UDP)) {
#if LUCA
if (header->caplen < ip_offset + ip_len + sizeof(struct ndpi_udphdr))
return(nproto); /* Too short for UDP header*/
#endif
struct ndpi_udphdr *udp = (struct ndpi_udphdr *)&packet[ip_offset+ip_len];
u_int16_t sport = ntohs(udp->source), dport = ntohs(udp->dest);