aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/TextDiagnosticPrinter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-18 22:09:16 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-18 22:09:16 +0000
commit1f0eb56d7cd1b24c21ac24112dfb41d3b29fb21c (patch)
tree8a739da62b8e563fa0aec192aaad32ead3194f0d /lib/Frontend/TextDiagnosticPrinter.cpp
parentb738e08cad7c9362e82a1384cf81fdce07d1b6ba (diff)
"This patch fixes an obvious buffer overrun in
SelectInterestingSourceRegion()," from Jay Foad! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72049 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r--lib/Frontend/TextDiagnosticPrinter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp
index 09c29109f1..b1c05336c2 100644
--- a/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -204,11 +204,11 @@ static void SelectInterestingSourceRegion(std::string &SourceLine,
// Skip over any whitespace we see here; we're looking for
// another bit of interesting text.
- while (CaretEnd != SourceLength && isspace(SourceLine[NewEnd - 1]))
+ while (NewEnd != SourceLength && isspace(SourceLine[NewEnd - 1]))
++NewEnd;
// Skip over this bit of "interesting" text.
- while (CaretEnd != SourceLength && !isspace(SourceLine[NewEnd - 1]))
+ while (NewEnd != SourceLength && !isspace(SourceLine[NewEnd - 1]))
++NewEnd;
if (NewEnd - CaretStart <= TargetColumns) {