From 0043022f0c037d07fc73d154058c163d5959a393 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 9 Dec 2022 12:03:36 +0400 Subject: [PATCH] cfg80211_rtw_scan: fix NULL pointer dereference in Wi-Fi Direct logic --- os_dep/linux/ioctl_cfg80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 17473cd..ead698a 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2958,7 +2958,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy #endif #ifdef CONFIG_P2P 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) ) { if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) @@ -3065,7 +3065,7 @@ bypass_p2p_chk: #ifdef CONFIG_P2P if (pwdinfo->driver_interface == DRIVER_CFG80211) { - if (ssids->ssid != NULL + if (ssids && _rtw_memcmp(ssids->ssid, "DIRECT-", 7) && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL) ) {