Module Name:    src
Committed By:   roy
Date:           Fri Sep 13 11:54:03 UTC 2019

Modified Files:
        src/external/bsd/dhcpcd/dist/src: dhcp.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/src/dhcp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.26 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.27
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.26	Fri Sep 13 11:01:50 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Fri Sep 13 11:54:03 2019
@@ -3264,7 +3264,13 @@ valid_udp_packet(void *packet, size_t pl
 	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;

Reply via email to