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
This commit is contained in:
committed by
Ashwini Patil
parent
c46bf72725
commit
1e2073ebaf
@@ -703,7 +703,6 @@ end:
|
|||||||
static s8 *qsap_get_allow_deny_file_name(s8 *pcfgfile, struct Command * pcmd, s8 *pfile, u32 *plen)
|
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)) {
|
if(eSUCCESS == qsap_read_cfg(pcfgfile, pcmd, pfile, plen, NULL, GET_ENABLED_ONLY)) {
|
||||||
pfile[*plen] = '\0';
|
|
||||||
return strchr(pfile, '=') + 1;
|
return strchr(pfile, '=') + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user