This commit is contained in:
roy 2019-09-13 11:54:03 +00:00
parent 21550a16b9
commit 0c95312c50
1 changed files with 6 additions and 0 deletions

View File

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