Browse Source

qcacld-3.0: Validate beacon before acessing he_cap

Issue: Currently, beacon presence validation is missing
and beacon->he_cap is validated which may cause null pointer
dereference in case he caps in assoc response and beacon both
are misssing.

Fix: Validate beacon piror to access of beacon->he_cap to avoid
null pointer dereference.

Change-Id: Ie8d41df3a9769897aba3c3c304ac2fa2abaf7950
CRs-Fixed: 2775366
sheenam monga 4 years ago
parent
commit
bf5047bfb8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/mac/src/pe/lim/lim_utils.c

+ 1 - 1
core/mac/src/pe/lim/lim_utils.c

@@ -6863,7 +6863,7 @@ void lim_update_stads_he_caps(struct mac_context *mac_ctx,
 	if (assoc_rsp->he_cap.present)
 		he_cap = &assoc_rsp->he_cap;
 	/* Use beacon HE caps if assoc resp doesn't have he caps */
-	else if (beacon->he_cap.present)
+	else if (beacon && beacon->he_cap.present)
 		he_cap = &beacon->he_cap;
 	else
 		return;