Clang: Fix possible out of bounds access in ClangFollowSymbol

Change-Id: I80132dca9c26a54059f2c1ba872b102df8e6e0d7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-09-18 14:42:20 +02:00
parent fa50153fc8
commit 9c7d546c14

View File

@@ -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;
}