diff options
author | Nardi Ivan <nardi.ivan@gmail.com> | 2024-09-16 16:22:50 +0200 |
---|---|---|
committer | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-09-16 17:30:39 +0200 |
commit | 3161c8a3de52d6ec273a59324e994bcbaef569de (patch) | |
tree | da8ec508991430736e1e17087ccff7e183959f86 /src/lib/protocols | |
parent | f3104240372794ab8572abd73ca0b90f79ce88f6 (diff) |
dhcp: fix out of bounds acces
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/dhcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/dhcp.c b/src/lib/protocols/dhcp.c index 564e5e243..4c400df9a 100644 --- a/src/lib/protocols/dhcp.c +++ b/src/lib/protocols/dhcp.c @@ -147,7 +147,7 @@ static void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struc u_int8_t len = ndpi_min(dhcp->options[i+1] /* len as found in the packet */, dhcp_options_size - (i+2) /* 1 for the type and 1 for the value */); - if(len == 0) + if(len == 0 || opt_offset >= sizeof(flow->protos.dhcp.options)) break; rc = ndpi_snprintf((char*)&flow->protos.dhcp.options[opt_offset], |