From 28af18d2d1226689923cadd7030d2f085253e6a3 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 23 Jul 2013 17:51:53 +1000 Subject: Fix potential write beyond allocation found by Visual C++ analyzer. --- lexers/LexCrontab.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lexers/LexCrontab.cxx') diff --git a/lexers/LexCrontab.cxx b/lexers/LexCrontab.cxx index 68f52e362..ad6668fa7 100644 --- a/lexers/LexCrontab.cxx +++ b/lexers/LexCrontab.cxx @@ -36,7 +36,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi char chNext = styler[startPos]; int lengthDoc = startPos + length; // create a buffer large enough to take the largest chunk... - char *buffer = new char[length]; + char *buffer = new char[length+1]; int bufferCount = 0; // used when highliting environment variables inside quoted string: bool insideString = false; -- cgit v1.2.3