diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-09-18 14:42:20 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-09-18 12:49:56 +0000 |
commit | 9c7d546c14517b1167376fee01e815d31a100475 (patch) | |
tree | e4fd14d3056b36976c6424b67ecdf6ec9fcb804c /src/plugins/clangcodemodel | |
parent | fa50153fc8f0ec992224007fa4101253d7554fcd (diff) | |
download | qt-creator-9c7d546c14517b1167376fee01e815d31a100475.tar.gz |
Clang: Fix possible out of bounds access in ClangFollowSymbol
Change-Id: I80132dca9c26a54059f2c1ba872b102df8e6e0d7
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel')
-rw-r--r-- | src/plugins/clangcodemodel/clangfollowsymbol.cpp | 4 |
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; } |