IEEE 802.11: Add a bounds check

This commit is contained in:
Francois-Xavier Le Bail 2018-06-18 21:47:43 +02:00
parent 662cec9566
commit 3f1c4af001

View File

@ -2045,6 +2045,10 @@ ieee802_11_print(netdissect_options *ndo,
hdrlen = roundup2(hdrlen, 4); hdrlen = roundup2(hdrlen, 4);
if (ndo->ndo_Hflag && FC_TYPE(fc) == T_DATA && if (ndo->ndo_Hflag && FC_TYPE(fc) == T_DATA &&
DATA_FRAME_IS_QOS(FC_SUBTYPE(fc))) { DATA_FRAME_IS_QOS(FC_SUBTYPE(fc))) {
if(!ND_TTEST_1(p + hdrlen)) {
nd_print_trunc(ndo);
return hdrlen;
}
meshdrlen = extract_mesh_header_length(p+hdrlen); meshdrlen = extract_mesh_header_length(p+hdrlen);
hdrlen += meshdrlen; hdrlen += meshdrlen;
} else } else