From adf163ed1ad19562af7badb4485bc2dc350ebd69 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Wed, 7 Sep 2016 15:11:58 +0530 Subject: [PATCH] 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) --- 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 1b182dbd1d22..2859d7552885 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/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);