forked from OSchip/llvm-project
"This patch fixes an obvious buffer overrun in
SelectInterestingSourceRegion()," from Jay Foad! llvm-svn: 72049
This commit is contained in:
parent
4182e32172
commit
8e35e2d7ae
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue