Skip to content

Commit 6d1d2c6

Browse files
authored
[clang] Fix a possible out-of-bounds read (#80023)
Fixes #79964
1 parent c2dea71 commit 6d1d2c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Frontend/TextDiagnostic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ highlightLines(StringRef FileData, unsigned StartLineNumber,
12511251
unsigned LineLength = 0;
12521252
for (unsigned I = 0; I <= Spelling.size(); ++I) {
12531253
// This line is done.
1254-
if (isVerticalWhitespace(Spelling[I]) || I == Spelling.size()) {
1254+
if (I == Spelling.size() || isVerticalWhitespace(Spelling[I])) {
12551255
SmallVector<TextDiagnostic::StyleRange> &LineRanges =
12561256
SnippetRanges[L - StartLineNumber];
12571257

0 commit comments

Comments
 (0)