aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-04-14 15:36:31 +1000
committerNeil <nyamatongwe@gmail.com>2014-04-14 15:36:31 +1000
commit2dab76f280e5696ebaf3d861aa70d78423d434e4 (patch)
treec63a2f9f1160e774e258fded8343023d0968e426
parentc9fa19d63496eef7484b260393917759eac0b14f (diff)
downloadscintilla-mirror-2dab76f280e5696ebaf3d861aa70d78423d434e4.tar.gz
Fix write one past array end bug.
-rw-r--r--lexers/LexCPP.cxx5
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;