[cfe-commits] r72049 - /cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp

Douglas Gregor dgregor at apple.com
Mon May 18 15:09:17 PDT 2009


Author: dgregor
Date: Mon May 18 17:09:16 2009
New Revision: 72049

URL: http://llvm.org/viewvc/llvm-project?rev=72049&view=rev
Log:
"This patch fixes an obvious buffer overrun in
SelectInterestingSourceRegion()," from Jay Foad!


Modified:
    cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp

Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=72049&r1=72048&r2=72049&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Mon May 18 17:09:16 2009
@@ -204,11 +204,11 @@
 
       // 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) {





More information about the cfe-commits mailing list