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.
(cherry picked from commit 71df50a973
)
This commit is contained in:
parent
5b20a2b19c
commit
530a18d493
@ -311,6 +311,9 @@ static int dhcp_server_send_unicast_raw(sd_dhcp_server *server,
|
||||
|
||||
memcpy(&link.ll.sll_addr, &packet->dhcp.chaddr, ETH_ALEN);
|
||||
|
||||
if (len > UINT16_MAX)
|
||||
return -EOVERFLOW;
|
||||
|
||||
dhcp_packet_append_ip_headers(packet, server->address, DHCP_PORT_SERVER,
|
||||
packet->dhcp.yiaddr,
|
||||
DHCP_PORT_CLIENT, len, -1);
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user