瀏覽代碼

qcacld-3.0: Avoid uninitialized use of variable

In send sta authorized event api, there is a possibility
of use of uninitialized use of structure variable mask
which may result in an invalid value of the mask.

To avoid uninitialized use of the structure variable,
mem set structure variable to zero before using it.

Change-Id: I2c8bbac949b55fd18928c5dca8744147b0a45415
CRs-Fixed: 2423878
Ashish Kumar Dhanotiya 5 年之前
父節點
當前提交
0dd9b8b56a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 2 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -14562,6 +14562,8 @@ QDF_STATUS wlan_hdd_send_sta_authorized_event(
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	qdf_mem_zero(&sta_flags, sizeof(sta_flags));
+
 	sta_flags.mask |= BIT(NL80211_STA_FLAG_AUTHORIZED);
 	sta_flags.set = true;