summaryrefslogtreecommitdiff
path: root/print-mptcp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-02 09:32:56 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-06-02 09:32:56 +0200
commitb1006d2e464dcbe9e65584f241796feb305688a2 (patch)
tree3272ee503c299a016b7e347023e47d67c8983daa /print-mptcp.c
parent5fe61e70f1afddf691b6a944dcd1e369194259ec (diff)
downloadtcpdump-b1006d2e464dcbe9e65584f241796feb305688a2.tar.gz
MPTCP: Add a bounds check
Diffstat (limited to 'print-mptcp.c')
-rw-r--r--print-mptcp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/print-mptcp.c b/print-mptcp.c
index 5a7cec8b..631b4e80 100644
--- a/print-mptcp.c
+++ b/print-mptcp.c
@@ -442,8 +442,13 @@ mptcp_print(netdissect_options *ndo,
return 0;
opt = (const struct mptcp_option *) cp;
+ ND_TCHECK_SIZE(opt);
subtype = min(MPTCP_OPT_SUBTYPE(opt->sub_etc), MPTCP_SUB_FCLOSE + 1);
ND_PRINT(" %s", mptcp_options[subtype].name);
return mptcp_options[subtype].print(ndo, cp, len, flags);
+
+trunc:
+ nd_print_trunc(ndo);
+ return 0;
}