aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-18 14:42:20 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-18 12:49:56 +0000
commit9c7d546c14517b1167376fee01e815d31a100475 (patch)
treee4fd14d3056b36976c6424b67ecdf6ec9fcb804c
parentfa50153fc8f0ec992224007fa4101253d7554fcd (diff)
Clang: Fix possible out of bounds access in ClangFollowSymbol
Change-Id: I80132dca9c26a54059f2c1ba872b102df8e6e0d7 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/clangcodemodel/clangfollowsymbol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/clangcodemodel/clangfollowsymbol.cpp b/src/plugins/clangcodemodel/clangfollowsymbol.cpp
index f503a777d2..dab5b52dc6 100644
--- a/src/plugins/clangcodemodel/clangfollowsymbol.cpp
+++ b/src/plugins/clangcodemodel/clangfollowsymbol.cpp
@@ -85,10 +85,10 @@ static int includePathStartIndex(const QVector<ClangBackEnd::TokenInfoContainer>
}
static int includePathEndIndex(const QVector<ClangBackEnd::TokenInfoContainer> &marks,
- int currentIndex)
+ int currentIndex)
{
int endIndex = currentIndex + 1;
- while (isValidIncludePathToken(marks[endIndex]))
+ while (endIndex < marks.size() && isValidIncludePathToken(marks[endIndex]))
++endIndex;
return endIndex - 1;
}