From 1e2073ebaf987cfcca09c52ac50f8335728b1480 Mon Sep 17 00:00:00 2001 From: Ashwini Sukhadev Patil Date: Sun, 6 Dec 2015 11:57:58 +0530 Subject: [PATCH] Softap: Avoid possible array index out-of-bounds access. Return value of snprintf can be more than size value when output is truncated, so copying the '\0' at return value may cause array index out-of-bound access. And as snprintf function takes care of terminating the string with '\0', its redundant to copy '\0' at return value. CRs-Fixed: 947966 Change-Id: Ic5dab6d9aa57db5000f23c82e2a22924e0154c40 --- softap/sdk/qsap_api.c | 1 - 1 file changed, 1 deletion(-) diff --git a/softap/sdk/qsap_api.c b/softap/sdk/qsap_api.c index 17e8be8..7f71be6 100644 --- a/softap/sdk/qsap_api.c +++ b/softap/sdk/qsap_api.c @@ -703,7 +703,6 @@ end: static s8 *qsap_get_allow_deny_file_name(s8 *pcfgfile, struct Command * pcmd, s8 *pfile, u32 *plen) { if(eSUCCESS == qsap_read_cfg(pcfgfile, pcmd, pfile, plen, NULL, GET_ENABLED_ONLY)) { - pfile[*plen] = '\0'; return strchr(pfile, '=') + 1; }