mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
sd-dhcp-server: refuse too large packet to send
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44134.
This commit is contained in:
parent
a663f5eef5
commit
71df50a973
@ -319,6 +319,9 @@ static int dhcp_server_send_unicast_raw(
|
|||||||
|
|
||||||
memcpy(link.ll.sll_addr, chaddr, hlen);
|
memcpy(link.ll.sll_addr, chaddr, hlen);
|
||||||
|
|
||||||
|
if (len > UINT16_MAX)
|
||||||
|
return -EOVERFLOW;
|
||||||
|
|
||||||
dhcp_packet_append_ip_headers(packet, server->address, DHCP_PORT_SERVER,
|
dhcp_packet_append_ip_headers(packet, server->address, DHCP_PORT_SERVER,
|
||||||
packet->dhcp.yiaddr,
|
packet->dhcp.yiaddr,
|
||||||
DHCP_PORT_CLIENT, len, -1);
|
DHCP_PORT_CLIENT, len, -1);
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user