aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-01-24 16:16:26 (GMT)
committerJouni Malinen <j@w1.fi>2011-01-24 16:16:26 (GMT)
commit2878cae7a7102da34588bbb0cfaf3e1c29c14cfe (patch)
tree5e814d6f988c4b109e7bdef95231ff59448ef193 /wlantest
parent5acf56f6a2b6dd549c626f77c63db47cffa3c860 (diff)
downloadhostap-2878cae7a7102da34588bbb0cfaf3e1c29c14cfe.zip
hostap-2878cae7a7102da34588bbb0cfaf3e1c29c14cfe.tar.gz
hostap-2878cae7a7102da34588bbb0cfaf3e1c29c14cfe.tar.bz2
wlantest: Handle missing fields in TDLS Setup Response error case
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_tdls.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wlantest/rx_tdls.c b/wlantest/rx_tdls.c
index 90f6a13..76a1bea 100644
--- a/wlantest/rx_tdls.c
+++ b/wlantest/rx_tdls.c
@@ -284,13 +284,14 @@ static void rx_data_tdls_setup_response(struct wlantest *wt, const u8 *bssid,
wpa_printf(MSG_DEBUG, "TDLS Setup Response " MACSTR " -> "
MACSTR " (status %d)",
MAC2STR(src), MAC2STR(dst), status);
- if (len < 5) {
+ if (len < 5 && status == 0) {
wpa_printf(MSG_INFO, "Too short TDLS Setup Response " MACSTR
" -> " MACSTR, MAC2STR(src), MAC2STR(dst));
return;
}
- if (ieee802_11_parse_elems(data + 5, len - 5, &elems, 1) ==
+ if (len < 5 ||
+ ieee802_11_parse_elems(data + 5, len - 5, &elems, 1) ==
ParseFailed || elems.link_id == NULL) {
/* Need to match TDLS link based on Dialog Token */
rx_data_tdls_setup_response_failure(wt, bssid, sta_addr,