qcacld-3.0: Avoid buffer overflow

Add max check for probe request length against max length of probe
request buffer to avoid buffer overflow.

Change-Id: Ie0fad7443b2c749c66bb9ad662625a16d3a840c3
CRs-Fixed: 2138555
This commit is contained in:
Padma, Santhosh Kumar 2017-11-07 18:40:17 +05:30 • committed by snandini
commit 8472cb885f

View file

@ -665,6 +665,13 @@ lim_send_sme_probe_req_ind(tpAniSirGlobal pMac,
MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG,
psessionEntry->peSessionId, msgQ.type));
if (ProbeReqIELen > sizeof(pSirSmeProbeReqInd->WPSPBCProbeReq.
probeReqIE)) {
ProbeReqIELen = sizeof(pSirSmeProbeReqInd->WPSPBCProbeReq.
probeReqIE);
}
pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIELen =
(uint16_t) ProbeReqIELen;
qdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE, pProbeReqIE,