summaryrefslogtreecommitdiff
path: root/print-802_11.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-08-08 13:41:44 -0700
committerGuy Harris <guy@alum.mit.edu>2018-08-08 13:41:44 -0700
commitcf99f0bc838a5f82391a72c1e074781cfacd4cef (patch)
treede01daa44307599d35af21a22fddfc14f65907bf /print-802_11.c
parent009bd798b51d25d1b7f0dc7629fe7350eff9cf73 (diff)
downloadtcpdump-cf99f0bc838a5f82391a72c1e074781cfacd4cef.tar.gz
Explicitly check to make sure the header length isn't too short.
Diffstat (limited to 'print-802_11.c')
-rw-r--r--print-802_11.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/print-802_11.c b/print-802_11.c
index 227e1bf3..8a4b3bdb 100644
--- a/print-802_11.c
+++ b/print-802_11.c
@@ -3089,6 +3089,15 @@ ieee802_11_radio_print(netdissect_options *ndo,
hdr = (const struct ieee80211_radiotap_header *)p;
len = EXTRACT_LE_U_2(hdr->it_len);
+ if (len < sizeof(*hdr)) {
+ /*
+ * The length is the length of the entire header, so
+ * it must be as large as the fixed-length part of
+ * the header.
+ */
+ nd_print_trunc(ndo);
+ return caplen;
+ }
/*
* If we don't have the entire radiotap header, just give up.