From 22fc992f59addb431f6a73c30e39d3beb6bbf2d7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 24 Mar 2008 21:14:55 +0000 Subject: [PATCH] Avoid overflowing buffer, patch by Algeris Kirtzidis! llvm-svn: 48741 --- clang/lib/Lex/PPLexerChange.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index bd0ff7f94a19..c15675114d31 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/lib/Lex/PPLexerChange.cpp @@ -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.