]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-nfs.c
CVE-2017-13005/NFS: Add two bounds checks before fetching data
[tcpdump] / print-nfs.c
index f3e8666e75f81cfc36b6ade10fbf66ca91af4ef3..4fd9c3f7dc5e4253e8eab6933751489c5e9afa24 100644 (file)
@@ -899,7 +899,11 @@ xid_map_enter(netdissect_options *ndo,
                UNALIGNED_MEMCPY(&xmep->client, &ip6->ip6_src, sizeof(ip6->ip6_src));
                UNALIGNED_MEMCPY(&xmep->server, &ip6->ip6_dst, sizeof(ip6->ip6_dst));
        }
+       if (!ND_TTEST(rp->rm_call.cb_proc))
+               return (0);
        xmep->proc = EXTRACT_32BITS(&rp->rm_call.cb_proc);
+       if (!ND_TTEST(rp->rm_call.cb_vers))
+               return (0);
        xmep->vers = EXTRACT_32BITS(&rp->rm_call.cb_vers);
        return (1);
 }