]> granicus.if.org Git - clang/commitdiff
Avoid overflowing buffer, patch by Algeris Kirtzidis!
authorChris Lattner <sabre@nondot.org>
Mon, 24 Mar 2008 21:14:55 +0000 (21:14 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 24 Mar 2008 21:14:55 +0000 (21:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48741 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPLexerChange.cpp

index bd0ff7f94a19a4719cb3c74ea538966596e00680..c15675114d314cf0d207b31d8461e824c3c6dfe0 100644 (file)
@@ -86,7 +86,7 @@ Token Preprocessor::LookAhead(unsigned N) {
   // 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.