ecere/gui/EditBox: Fixed out of bound reads checking for brackets
authorJerome St-Louis <jerome@ecere.com>
Thu, 10 Apr 2014 06:21:25 +0000 (02:21 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 10 Apr 2014 06:21:25 +0000 (02:21 -0400)
ecere/src/gui/controls/EditBox.ec

index 5755d61..783332f 100644 (file)
@@ -3758,7 +3758,7 @@ private:
                   stuffAfter = true;
 
                //If last character is a { indent one tab
-               if(this.line.buffer[this.x - 1] == '{')
+               if(x > 0 && x < line.count && line.buffer[x - 1] == '{')
                {
                   //Except if the next non space character is a }
                   bool indent = false;