ソースを参照

qcacld-3.0: Validate bssDescription before using it

Validate bssDescription before dereferencing it.

Change-Id: I89f8c07ad2e38e59dd2a002ce95cfac88232ccc9
CRs-Fixed: 2729263
Gururaj Pandurangi 4 年 前
コミット
77ba18197c
1 ファイル変更5 行追加2 行削除
  1. 5 2
      core/mac/src/pe/lim/lim_assoc_utils.c

+ 5 - 2
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -1628,8 +1628,7 @@ QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
 	uint8_t aRateIndex = 0;
 	uint8_t bRateIndex = 0;
 	tDot11fIEhe_cap *peer_he_caps;
-	struct bss_description *bssDescription =
-		&pe_session->lim_join_req->bssDescription;
+	struct bss_description *bssDescription;
 	tSchBeaconStruct *pBeaconStruct = NULL;
 
 	/* copy operational rate set from pe_session */
@@ -1758,6 +1757,10 @@ QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
 		peer_he_caps = he_caps;
 	} else {
 		bssDescription = &pe_session->lim_join_req->bssDescription;
+		if (!bssDescription) {
+			pe_err("bssDescription is NULL");
+			return QDF_STATUS_E_INVAL;
+		}
 		pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 		if (!pBeaconStruct)
 			return QDF_STATUS_E_NOMEM;