qcacld-3.0: Add a SSID length check

Add a SSID length validation check before
copying the SSID field to scan request
structure from connect profile.

Change-Id: Ic6297a28f8852db2e5d22c5c7d5b8eab7b76dbfd
CRs-Fixed: 2145706
This commit is contained in:
Sandeep Puligilla 2017-11-07 01:20:32 -08:00 • committed by snandini
commit c0f7744dc3

View file

@ -4167,6 +4167,12 @@ QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal mac_ctx, uint32_t session_id,
/* Extend it for multiple SSID */
if (profile->SSIDs.numOfSSIDs) {
if (profile->SSIDs.SSIDList[0].SSID.length > MAX_SSID_LEN) {
sme_debug("wrong ssid length = %d",
profile->SSIDs.SSIDList[0].SSID.length);
status = QDF_STATUS_E_INVAL;
goto error;
}
req->scan_req.num_ssids = 1;
qdf_mem_copy(&req->scan_req.ssid[0].ssid,
&profile->SSIDs.SSIDList[0].SSID.ssId,