提交 6646a664 编写于 作者: Z Zhu Yi 提交者: John W. Linville

iwmc3200wifi: fix NULL pointer dereference in pmkid update

When handling IWM_CMD_PMKID_FLUSH command, the bssid and
pmkid in pmksa are all NULL. Check it before memcpy.
Signed-off-by: NZhu Yi <yi.zhu@intel.com>
Acked-by: NSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 914828fa
......@@ -970,8 +970,10 @@ int iwm_send_pmkid_update(struct iwm_priv *iwm,
memset(&update, 0, sizeof(struct iwm_umac_pmkid_update));
update.command = cpu_to_le32(command);
memcpy(&update.bssid, pmksa->bssid, ETH_ALEN);
memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN);
if (pmksa->bssid)
memcpy(&update.bssid, pmksa->bssid, ETH_ALEN);
if (pmksa->pmkid)
memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN);
ret = iwm_send_wifi_if_cmd(iwm, &update,
sizeof(struct iwm_umac_pmkid_update), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册