]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-nfs.c
(for 4.9.3) CVE-2018-14470/Babel: fix an existing length check
[tcpdump] / print-nfs.c
index 4fd9c3f7dc5e4253e8eab6933751489c5e9afa24..2118a963fb464fea2c271a28641e7c3e37ba6ad5 100644 (file)
@@ -870,7 +870,7 @@ xid_map_enter(netdissect_options *ndo,
        const struct ip6_hdr *ip6 = NULL;
        struct xid_map_entry *xmep;
 
-       if (!ND_TTEST(rp->rm_call.cb_vers))
+       if (!ND_TTEST(rp->rm_call.cb_proc))
                return (0);
        switch (IP_V((const struct ip *)bp)) {
        case 4:
@@ -899,11 +899,7 @@ 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);
 }
@@ -1572,8 +1568,8 @@ interp_reply(netdissect_options *ndo,
                                                tok2str(nfsv3_writemodes,
                                                        NULL, EXTRACT_32BITS(&dp[1]))));
                                }
-                               return;
                        }
+                       return;
                } else {
                        if (parseattrstat(ndo, dp, ndo->ndo_vflag, v3) != 0)
                                return;
@@ -1659,8 +1655,8 @@ interp_reply(netdissect_options *ndo,
                                ND_PRINT((ndo, " dir:"));
                                if (!(dp = parse_wcc_data(ndo, dp, ndo->ndo_vflag)))
                                        break;
-                               return;
                        }
+                       return;
                } else {
                        if (parsestatus(ndo, dp, &er) != NULL)
                                return;