1
1
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:
Yu Watanabe 2022-01-28 11:53:49 +09:00 committed by Luca Boccassi
parent 5b20a2b19c
commit 530a18d493
2 changed files with 3 additions and 0 deletions

View File

@ -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);