From 163945f4b41afade6015e2a38e249899013d43cd Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 5 Dec 2016 18:25:39 +0100 Subject: Added check to avoid loops with invalid DHCP packets --- src/lib/protocols/dhcp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lib/protocols/dhcp.c b/src/lib/protocols/dhcp.c index 49cf19147..f597d6ced 100644 --- a/src/lib/protocols/dhcp.c +++ b/src/lib/protocols/dhcp.c @@ -80,6 +80,8 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru u_int8_t id = dhcp->options[i]; u_int8_t len = dhcp->options[i+1]; + if(len == 0) break; + #ifdef DHCP_DEBUG printf("[DHCP] Id=%d [len=%d]\n", id, len); #endif -- cgit v1.2.3