qcacld-3.0: Add validation code in __lim_process_roam_scan_offload_req

In function __lim_process_roam_scan_offload_req add validation code
to avoid buffer overflow during memcopy.

Change-Id: I2ac02e276dd7e4df0a6dffe58181ff538b49ed74
CRs-Fixed: 1082162
(cherry picked from commit 9806f9cfe464fb7ebebbf1a1f27c2b0b39cb1ffd)
This commit is contained in:
Arif Hussain 2016-10-25 15:24:08 -07:00 • committed by Gerrit - the friendly Code Review server
commit c2bb440175

View file

@ -4165,9 +4165,12 @@ static void __lim_process_roam_scan_offload_req(tpAniSirGlobal mac_ctx,
if (local_ie_len &&
!lim_update_ext_cap_ie(mac_ctx, req_buffer->assoc_ie.addIEdata,
local_ie_buf, &local_ie_len)) {
req_buffer->assoc_ie.length = local_ie_len;
qdf_mem_copy(req_buffer->assoc_ie.addIEdata, local_ie_buf,
local_ie_len);
if (local_ie_len <=
QDF_ARRAY_SIZE(req_buffer->assoc_ie.addIEdata)) {
req_buffer->assoc_ie.length = local_ie_len;
qdf_mem_copy(req_buffer->assoc_ie.addIEdata,
local_ie_buf, local_ie_len);
}
}
qdf_mem_free(local_ie_buf);