Bläddra i källkod

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)
Hanumanth Reddy Pothula 8 år sedan
förälder
incheckning
adf163ed1a
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      core/hdd/src/wlan_hdd_cfg.c

+ 1 - 1
core/hdd/src/wlan_hdd_cfg.c

@@ -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);