Fix buffer overflow in PrintMacroDefinition() by inverting the check to see if the target buffer needs to be resized. Fixes <rdar://problem/7255377>.
llvm-svn: 85872
This commit is contained in:
parent
8d681f0471
commit
66791d5dc5
|
@ -66,7 +66,7 @@ static void PrintMacroDefinition(const IdentifierInfo &II, const MacroInfo &MI,
|
|||
OS << ' ';
|
||||
|
||||
// Make sure we have enough space in the spelling buffer.
|
||||
if (I->getLength() < SpellingBuffer.size())
|
||||
if (I->getLength() > SpellingBuffer.size())
|
||||
SpellingBuffer.resize(I->getLength());
|
||||
const char *Buffer = SpellingBuffer.data();
|
||||
unsigned SpellingLen = PP.getSpelling(*I, Buffer);
|
||||
|
|
Loading…
Reference in New Issue