From: d.saraswat Date: Mon, 28 Jan 2019 06:43:58 +0000 (+0530) Subject: [SVACE] Resolves out of range exception X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=923678c4c5c1a8c4f45a0076d0bae77d5cf3d3ec;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git [SVACE] Resolves out of range exception Applied extra check on index of substring so that it lies within size of string. Change-Id: I9dd8f079e24aed911e71a8b2b7e4e69d69a17c96 Signed-off-by: d.saraswat --- diff --git a/common/profiler.cc b/common/profiler.cc index a71e79701..8426adc28 100644 --- a/common/profiler.cc +++ b/common/profiler.cc @@ -52,7 +52,7 @@ ScopeProfile::ScopeProfile(const char* step, const bool isStep) // Remove return type and parameter info from __PRETTY_FUNCTION__ int se = step_.find_first_of('('); int ss = step_.find_last_of(' ', se) + 1; - if (ss < se) { + if ((ss < se) && ((se-ss) < strlen(step_.c_str()))) { step_ = step_.substr(ss, se - ss); } }