summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsiu-Chang Chen <hsiuchangchen@google.com>2022-03-09 14:38:47 -0800
committerHsiu-Chang Chen <hsiuchangchen@google.com>2022-08-08 16:22:20 +0800
commit53d929c7ff6da75c14de19da766ad90f41a73ece (patch)
tree6a9167f52235a4db4cbfc7651fae2f21255e2d68
parentd20cc0963ea6abe5c2c0185e2eb1318e8eea3ff1 (diff)
downloadqcacld-53d929c7ff6da75c14de19da766ad90f41a73ece.tar.gz
qcacld-3.0: Add pointer check before dereferencing
Make sure the parsed association request array is valid at the association ID index, before dereferencing it. This will prevent NULL pointer deref. There is already a check for the beginning of the parsed assoc req array, but it is not checking at the assoc ID index. Bug: 240972788 Test Regression Test Change-Id: Icac3b2a4a0646dec4c64a2224e3271b0842a8194 CRs-Fixed: 3147273
-rw-r--r--core/mac/src/pe/lim/lim_assoc_utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c
index fe7b8b8242..b4e15cdd55 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -2605,9 +2605,11 @@ lim_add_sta(struct mac_context *mac_ctx,
assoc_req =
(tpSirAssocReq) session_entry->parsedAssocReq[aid];
- add_sta_params->wpa_rsn = assoc_req->rsnPresent;
- add_sta_params->wpa_rsn |=
- (assoc_req->wpaPresent << 1);
+ if (assoc_req) {
+ add_sta_params->wpa_rsn = assoc_req->rsnPresent;
+ add_sta_params->wpa_rsn |=
+ (assoc_req->wpaPresent << 1);
+ }
}
}