Skip to content

Commit

Permalink
dhcp: fix memory corruption when LWIP_DHCP_MAX_DNS_SERVERS > DNS_MAX_…
Browse files Browse the repository at this point in the history
…SERVERS

see patch #10124
  • Loading branch information
goldsimon committed Oct 12, 2023
1 parent b9ca1de commit 1eeb70f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/ipv4/dhcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ dhcp_parse_reply(struct pbuf *p, struct dhcp *dhcp)
/* special case: there might be more than one server */
LWIP_DHCP_INPUT_ERROR("len %% 4 == 0", len % 4 == 0, return ERR_VAL;);
/* limit number of DNS servers */
decode_len = LWIP_MIN(len, 4 * DNS_MAX_SERVERS);
decode_len = LWIP_MIN(len, 4 * LWIP_DHCP_PROVIDE_DNS_SERVERS);
LWIP_DHCP_INPUT_ERROR("len >= decode_len", len >= decode_len, return ERR_VAL;);
decode_idx = DHCP_OPTION_IDX_DNS_SERVER;
break;
Expand Down

0 comments on commit 1eeb70f

Please sign in to comment.