qcacld-3.0: Resolve buffer overflow issue while processing GET_CFG IOCTL

qcacld-2.0 to qcacld-3.0 propagation.

There is a possibility of buffer overflow while processing
GET_CFG IOCTL to retrieve ini parameters from a global array,
because of invalid if condition.
Resolve buffer overflow issue by correcting if condition.

Change-Id: I8881abde0b543d7b1562968ecbb6240a0ca552a3
CRs-Fixed: 1000853
(cherry picked from commit 2dff47b5bc87559c430da20bf563975749b2a8cd)
This commit is contained in:
Hanumanth Reddy Pothula 2016-09-07 15:11:58 +05:30 • committed by qcabuildsw
commit adf163ed1a

View file

@ -4181,7 +4181,7 @@ static QDF_STATUS hdd_cfg_get_config(REG_TABLE_ENTRY *reg_table,
* however the config is too big so we just printk() for now
*/
#ifdef RETURN_IN_BUFFER
if (curlen <= buflen) {
if (curlen < buflen) {
/* copy string + '\0' */
memcpy(pCur, configStr, curlen + 1);