]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Untrusted val as argument (Coverity 1465491)
authorpaco <paco@voltanet.io>
Fri, 15 Jun 2018 10:57:47 +0000 (12:57 +0200)
committerpaco <paco@voltanet.io>
Fri, 15 Jun 2018 12:46:25 +0000 (14:46 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
pimd/mtracebis.c

index a073fa70beeead052838a736e6b6a79c5809dd66..731fdb1beb5c5e71f9d382820e30439549a41c0d 100644 (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;