[cfe-commits] r48741 - /cfe/trunk/lib/Lex/PPLexerChange.cpp

Chris Lattner sabre at nondot.org
Mon Mar 24 14:14:55 PDT 2008


Author: lattner
Date: Mon Mar 24 16:14:55 2008
New Revision: 48741

URL: http://llvm.org/viewvc/llvm-project?rev=48741&view=rev
Log:
Avoid overflowing buffer, patch by Algeris Kirtzidis!

Modified:
    cfe/trunk/lib/Lex/PPLexerChange.cpp

Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=48741&r1=48740&r2=48741&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Mon Mar 24 16:14:55 2008
@@ -86,7 +86,7 @@
   // left, we can just grow it.  This means we only have to do the new 1/16th as
   // often.
   
-  Token *LookaheadTokens = new Token[N];
+  Token *LookaheadTokens = new Token[N+1];
 
   // Read N+1 tokens into LookaheadTokens.  After this loop, Tok is the token
   // to return.





More information about the cfe-commits mailing list