Merge pull request #2457 from pacovn/Coverity_1465491_Untrusted_value_as_argument

pimd: Untrusted val as argument (Coverity 1465491)
This commit is contained in:
Donald Sharp 2018-06-18 11:55:53 -04:00 committed by GitHub
commit 36de1d53b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -296,6 +296,10 @@ static int recv_response(int fd, int *hops, struct igmp_mtrace *mtracer)
mtrace_len = ntohs(ip->ip_len) - ip->ip_hl * 4;
if ((char *)mtrace + mtrace_len
> (char *)mtrace_buf + IP_AND_MTRACE_BUF_LEN)
return -1;
if (mtrace_len < (int)MTRACE_HDR_SIZE)
return -1;