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:
Spenser Reinhardt 2014-06-22 16:02:19 -05:00 committed by Jan Wagner
parent 5866cb0a09
commit e7e6edb2f8

View file

@ -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;