aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2016-12-05 18:25:39 +0100
committerLuca Deri <deri@ntop.org>2016-12-05 18:25:39 +0100
commit163945f4b41afade6015e2a38e249899013d43cd (patch)
tree43ff42068269b5107a5ddaa8e97847f94c77d767 /src
parent22ee4392158fcbd94b4f4111832e28503b07e615 (diff)
Added check to avoid loops with invalid DHCP packets
Diffstat (limited to 'src')
-rw-r--r--src/lib/protocols/dhcp.c2
1 files changed, 2 insertions, 0 deletions
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