diff options
author | Neil <nyamatongwe@gmail.com> | 2014-04-14 15:36:31 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-04-14 15:36:31 +1000 |
commit | 2a71ca395b8ab9f9998829e689a4c9bbddfa5316 (patch) | |
tree | e94818ad9d16d0ac991c3aed57cfefcef68b39c8 /lexers/LexCPP.cxx | |
parent | 41a622afbc2afa87992850991e6d8f6f8e43160e (diff) | |
download | scintilla-mirror-2a71ca395b8ab9f9998829e689a4c9bbddfa5316.tar.gz |
Fix write one past array end bug.
Diffstat (limited to 'lexers/LexCPP.cxx')
-rw-r--r-- | lexers/LexCPP.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 99f598722..5bcd0b4df 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -86,10 +86,11 @@ static bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) { static void highlightTaskMarker(StyleContext &sc, LexAccessor &styler, int activity, WordList &markerList, bool caseSensitive){ if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) { - char marker[50]; + const int lengthMarker = 50; + char marker[lengthMarker+1]; int currPos = (int) sc.currentPos; int i = 0; - while (i < 50) { + while (i < lengthMarker) { char ch = styler.SafeGetCharAt(currPos + i); if (IsASpace(ch) || isoperator(ch)) { break; |