summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-02 23:38:18 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-02 23:38:18 +0200
commita7fd3229d55699283f57513eb1ca7b31c789cbd4 (patch)
treec0725405bb71a820f479b6e5e34ce0d7f8148b73
parent663aa08e8b1aa722d9e5907e11591175a3630fb0 (diff)
downloadtcpdump-a7fd3229d55699283f57513eb1ca7b31c789cbd4.tar.gz
SUNRPC: Add a bounds check
-rw-r--r--print-sunrpc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/print-sunrpc.c b/print-sunrpc.c
index d5ffe8d4..f83f4eb9 100644
--- a/print-sunrpc.c
+++ b/print-sunrpc.c
@@ -169,6 +169,7 @@ sunrpc_print(netdissect_options *ndo, const u_char *bp,
ndo->ndo_protocol = "sunrpc";
rp = (const struct sunrpc_msg *)bp;
+ ND_TCHECK_SIZE(rp);
if (!ndo->ndo_nflag) {
nd_snprintf(srcid, sizeof(srcid), "0x%x",
@@ -218,6 +219,10 @@ sunrpc_print(netdissect_options *ndo, const u_char *bp,
ND_PRINT(".%u", EXTRACT_BE_U_4(rp->rm_call.cb_vers));
break;
}
+ return;
+
+trunc:
+ nd_print_trunc(ndo);
}
static char *