Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8b890da authored by Lincoln Tran's avatar Lincoln Tran
Browse files

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.

Change-Id: Icac3b2a4a0646dec4c64a2224e3271b0842a8194
CRs-Fixed: 3147273
parent 7200c082
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -2551,11 +2552,13 @@ lim_add_sta(struct mac_context *mac_ctx,
			assoc_req =
			(tpSirAssocReq) session_entry->parsedAssocReq[aid];

			if (assoc_req) {
				add_sta_params->wpa_rsn = assoc_req->rsnPresent;
				add_sta_params->wpa_rsn |=
					(assoc_req->wpaPresent << 1);
			}
		}
	}

	lim_update_he_stbc_capable(add_sta_params);
	lim_update_he_mcs_12_13(add_sta_params, sta_ds);