fixed bug #49676 (Possible endless loop when parsing dhcp options) & added unit test for that

This commit is contained in:
goldsimon
2016-11-25 10:03:43 +01:00
parent 2ed755764e
commit 0e07ed4b13
3 changed files with 114 additions and 2 deletions

View File

@@ -1541,6 +1541,8 @@ again:
#endif /* LWIP_DHCP_GET_NTP_SRV*/
case(DHCP_OPTION_OVERLOAD):
LWIP_ERROR("len == 1", len == 1, return ERR_VAL;);
/* decode overload only in options, not in file/sname: invalid packet */
LWIP_ERROR("overload in file/sname", options_idx == DHCP_OPTIONS_OFS, return ERR_VAL;);
decode_idx = DHCP_OPTION_IDX_OVERLOAD;
break;
case(DHCP_OPTION_MESSAGE_TYPE):