Преглед на файлове

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;