From 0c95312c507bc2dea3a42bb5e3e40ed55dab7e45 Mon Sep 17 00:00:00 2001 From: roy Date: Fri, 13 Sep 2019 11:54:03 +0000 Subject: [PATCH] Sync --- external/bsd/dhcpcd/dist/src/dhcp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/external/bsd/dhcpcd/dist/src/dhcp.c b/external/bsd/dhcpcd/dist/src/dhcp.c index 3d8e46bdebc9..1fb2f4a10fcd 100644 --- a/external/bsd/dhcpcd/dist/src/dhcp.c +++ b/external/bsd/dhcpcd/dist/src/dhcp.c @@ -3264,7 +3264,13 @@ valid_udp_packet(void *packet, size_t plen, struct in_addr *from, if (from != NULL) from->s_addr = ip->ip_src.s_addr; + /* Check we have the IP header */ ip_hlen = (size_t)ip->ip_hl * 4; + if (ip_hlen > plen) { + errno = ENOBUFS; + return -1; + } + if (in_cksum(ip, ip_hlen, NULL) != 0) { errno = EINVAL; return -1;