diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-18 22:09:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-18 22:09:16 +0000 |
commit | 8e35e2d7ae89c3153af7388c223802e30556dbba (patch) | |
tree | a0f6ab272c91b13359a272e404ae1e71592199d5 /clang/lib/Frontend/TextDiagnosticPrinter.cpp | |
parent | 4182e3217237e6bba4debcbdc50372dcf7cc253d (diff) | |
download | bcm5719-llvm-8e35e2d7ae89c3153af7388c223802e30556dbba.tar.gz bcm5719-llvm-8e35e2d7ae89c3153af7388c223802e30556dbba.zip |
"This patch fixes an obvious buffer overrun in
SelectInterestingSourceRegion()," from Jay Foad!
llvm-svn: 72049
Diffstat (limited to 'clang/lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 09c29109f18..b1c05336c23 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/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) { |