Merge pull request #303 from edigaryev/fix-null-pointer-dereference

cfg80211_rtw_scan: fix NULL pointer dereference in Wi-Fi Direct logic
This commit is contained in:
Carlos Garcés 2022-12-25 20:08:26 +01:00 committed by GitHub
commit f51fb0eaa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2958,7 +2958,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
#endif #endif
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (pwdinfo->driver_interface == DRIVER_CFG80211) { if (pwdinfo->driver_interface == DRIVER_CFG80211) {
if (_rtw_memcmp(ssids->ssid, "DIRECT-", 7) if (ssids && _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL) && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
) { ) {
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -3065,7 +3065,7 @@ bypass_p2p_chk:
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (pwdinfo->driver_interface == DRIVER_CFG80211) { if (pwdinfo->driver_interface == DRIVER_CFG80211) {
if (ssids->ssid != NULL if (ssids
&& _rtw_memcmp(ssids->ssid, "DIRECT-", 7) && _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL) && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
) { ) {