udhcpc: check read of overload option data byte to be within packet

function                                             old     new   delta
udhcp_get_option                                     220     225      +5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-10-25 14:25:52 +02:00
parent f9beeb22e2
commit f11c6989ba

View File

@ -268,7 +268,8 @@ uint8_t* FAST_FUNC udhcp_get_option(struct dhcp_packet *packet, int code)
}
if (optionptr[OPT_CODE] == DHCP_OPTION_OVERLOAD) {
overload |= optionptr[OPT_DATA];
if (len >= 3)
overload |= optionptr[OPT_DATA];
/* fall through */
}
optionptr += len;