From bf5047bfb83260c083166808fce65337857365e7 Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Mon, 14 Sep 2020 14:21:23 +0530 Subject: [PATCH] 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 --- core/mac/src/pe/lim/lim_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index b1e7c6cf5c57..cbdb90c0fc54 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/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;