From 4d42a1d2810a3866e7ff41fc1f62894d2225e381 Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Tue, 19 Sep 2017 11:04:49 -0700 Subject: [PATCH] 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 --- softap/sdk/qsap_api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/softap/sdk/qsap_api.c b/softap/sdk/qsap_api.c index 5a29389..061c501 100644 --- a/softap/sdk/qsap_api.c +++ b/softap/sdk/qsap_api.c @@ -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) {