aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ibss_rsn.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-10 19:53:17 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-10 19:53:17 (GMT)
commita416fb47eb61f879b8275691dbbc56b2430faa1a (patch)
tree3cc00fbd3d025e7cd866a778e381fd0769ea7b44 /wpa_supplicant/ibss_rsn.c
parent2e320d8db59b8a37e3d68955ceb001a7c8efd763 (diff)
downloadhostap-a416fb47eb61f879b8275691dbbc56b2430faa1a.zip
hostap-a416fb47eb61f879b8275691dbbc56b2430faa1a.tar.gz
hostap-a416fb47eb61f879b8275691dbbc56b2430faa1a.tar.bz2
IBSS RSN: Explicitly check addr != NULL before passing it to memcmp
idx == 0 should be enough to make sure that the addr is set, but verify that this is indeed the case to avoid any potential issues if auth_set_key() gets called incorrectly.
Diffstat (limited to 'wpa_supplicant/ibss_rsn.c')
-rw-r--r--wpa_supplicant/ibss_rsn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index 8907600..0e33253 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -261,7 +261,8 @@ static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
* In IBSS RSN, the pairwise key from the 4-way handshake
* initiated by the peer with highest MAC address is used.
*/
- if (os_memcmp(ibss_rsn->wpa_s->own_addr, addr, ETH_ALEN) < 0) {
+ if (addr == NULL ||
+ os_memcmp(ibss_rsn->wpa_s->own_addr, addr, ETH_ALEN) < 0) {
wpa_printf(MSG_DEBUG, "AUTH: Do not use this PTK");
return 0;
}