fix issue: fmClient segfaults on short string parameter
It is due to out of range access violation. Fix it by checking length before access. Closes-Bug: 1807986 Change-Id: Iba2b445f50fd98a74d932c9b3f691fc7145274bb Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
This commit is contained in:
parent
80a9ad661f
commit
6493976162
@ -205,6 +205,8 @@ static std::string chkstr(const std::string &s) {
|
||||
static void str_to_vector(const std::string &s, std::vector<std::string> &alarm) {
|
||||
size_t offset = 0;
|
||||
alarm.clear();
|
||||
if (s.length() <= 3)
|
||||
return ;
|
||||
while (true) {
|
||||
size_t beg = (offset==0) ? 0 : s.find("###",offset);
|
||||
if (beg==std::string::npos) break;
|
||||
|
Loading…
Reference in New Issue
Block a user