Commit 80e5b06a authored by Zhu Yi's avatar Zhu Yi Committed by John W. Linville

cfg80211: fix NULL dereference in IBSS SIOCGIWAP

This patch avoids memcpy from wdev->wext.ibss.bssid if it is NULL.
This could happen if we SIOCGIWAP before SIOCSIWAP.
Signed-off-by: default avatarZhu Yi <>
Signed-off-by: default avatarJohn W. Linville <>
parent f874011b
......@@ -487,8 +487,11 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,
if (wdev->current_bss)
memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN);
else if (wdev->wext.ibss.bssid)
memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN);
memset(ap_addr->sa_data, 0, ETH_ALEN);
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment