"This patch fixes an obvious buffer overrun in

SelectInterestingSourceRegion()," from Jay Foad!

llvm-svn: 72049
This commit is contained in:
Douglas Gregor 2009-05-18 22:09:16 +00:00
parent 4182e32172
commit 8e35e2d7ae
1 changed files with 2 additions and 2 deletions

View File

@ -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) {