mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-25 16:17:16 -04:00
plugins-root/check_dhcp.c - array out of bounds
Coverity 66488 - offer_packet->options has a max size of 312. It was being used in a loop verifying less than 311, but increasing by 2 per loop, causing a possible array index out of bounds. Changed to checking less than max length - 1. - SR
This commit is contained in:
parent
5866cb0a09
commit
e7e6edb2f8
1 changed files with 1 additions and 1 deletions
|
|
@ -837,7 +837,7 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
|
|||
return ERROR;
|
||||
|
||||
/* process all DHCP options present in the packet */
|
||||
for(x=4;x<MAX_DHCP_OPTIONS_LENGTH;){
|
||||
for(x=4;x<MAX_DHCP_OPTIONS_LENGTH-1;){
|
||||
|
||||
if((int)offer_packet->options[x]==-1)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue