diff options
author | Neil <nyamatongwe@gmail.com> | 2013-07-23 17:51:53 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-07-23 17:51:53 +1000 |
commit | 28af18d2d1226689923cadd7030d2f085253e6a3 (patch) | |
tree | ad0aabe13657b28c92bac1e8cb2f04adb6b75c15 | |
parent | fc66659e53fe8623e6b0b639c01c493dc1b380aa (diff) | |
download | scintilla-mirror-28af18d2d1226689923cadd7030d2f085253e6a3.tar.gz |
Fix potential write beyond allocation found by Visual C++ analyzer.
-rw-r--r-- | lexers/LexConf.cxx | 2 | ||||
-rw-r--r-- | lexers/LexCrontab.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lexers/LexConf.cxx b/lexers/LexConf.cxx index cbd01094d..6a1c8c018 100644 --- a/lexers/LexConf.cxx +++ b/lexers/LexConf.cxx @@ -37,7 +37,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k 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; // this assumes that we have 2 keyword list in conf.properties 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; |