https://github.com/tbaederr updated 
https://github.com/llvm/llvm-project/pull/80023

>From 046ac37551071c226ce155d25241d6676133d208 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbae...@redhat.com>
Date: Tue, 30 Jan 2024 17:04:23 +0100
Subject: [PATCH] [clang] Fix a possible out-of-bounds read

Fixes #79964
---
 clang/lib/Frontend/TextDiagnostic.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Frontend/TextDiagnostic.cpp 
b/clang/lib/Frontend/TextDiagnostic.cpp
index 291d71f6db61f..a32ed443ab2e9 100644
--- a/clang/lib/Frontend/TextDiagnostic.cpp
+++ b/clang/lib/Frontend/TextDiagnostic.cpp
@@ -1251,7 +1251,7 @@ highlightLines(StringRef FileData, unsigned 
StartLineNumber,
     unsigned LineLength = 0;
     for (unsigned I = 0; I <= Spelling.size(); ++I) {
       // This line is done.
-      if (isVerticalWhitespace(Spelling[I]) || I == Spelling.size()) {
+      if (I == Spelling.size() || isVerticalWhitespace(Spelling.at(I))) {
         SmallVector<TextDiagnostic::StyleRange> &LineRanges =
             SnippetRanges[L - StartLineNumber];
 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to