From 6ba9136879232442a182996427e5c88e5a7512a8 Mon Sep 17 00:00:00 2001 From: Hanumantha Reddy Pothula Date: Wed, 13 Apr 2016 10:50:46 +0530 Subject: qcacld-2.0: Resolve buffer overflow issue while processing GET_CFG IOCTL 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 --- CORE/HDD/src/wlan_hdd_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 2904284..1a669d9 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -4974,7 +4974,7 @@ static VOS_STATUS hdd_cfg_get_config(REG_TABLE_ENTRY *reg_table, // ideally we want to return the config to the application // 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); -- cgit v1.1