softap: Fix KW issue for array index out of bounds

Check the length of the buffer before using it calculate
the index of the data in the buffer to prevent index becoming
a negative value.

Change-Id: I3dc440dac2e4a5437e2ff70c39577876a3a97123
CRs-fixed: 2111307
This commit is contained in:
Peng Xu 2017-09-19 11:04:49 -07:00
parent a7f0080a40
commit 4d42a1d281

View file

@ -260,6 +260,9 @@ static s32 qsap_read_cfg(s8 *pfile, struct Command * pcmd, s8 *presp, u32 *plen,
while(NULL != fgets(buf, MAX_CONF_LINE_LEN, fcfg)) {
s8 *pline = buf;
if (strlen(buf) == 0)
continue;
/** Skip the commented lines */
if(buf[0] == '#') {
if (ignore_comment) {