aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-12-04 17:11:01 +1100
committerNeil <nyamatongwe@gmail.com>2015-12-04 17:11:01 +1100
commit7b5476dae723cc94adeae1460c068aa686f4583b (patch)
tree9bd9c94aa1d963b943bd32dd091fcd18b80797dc /src/Editor.cxx
parentc4f4ef3948dd1f1f517608056de1ecaf3bd2d552 (diff)
downloadscintilla-mirror-7b5476dae723cc94adeae1460c068aa686f4583b.tar.gz
Fix some problems with out-of-bounds access for protected text.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 5014b2abb..170f6a931 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -794,15 +794,15 @@ SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int mov
pos.SetPosition(posMoved);
if (vs.ProtectionActive()) {
if (moveDir > 0) {
- if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()) {
+ if ((pos.Position() > 0) && vs.styles[pdoc->StyleIndexAt(pos.Position() - 1)].IsProtected()) {
while ((pos.Position() < pdoc->Length()) &&
- (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()))
+ (vs.styles[pdoc->StyleIndexAt(pos.Position())].IsProtected()))
pos.Add(1);
}
} else if (moveDir < 0) {
- if (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()) {
+ if (vs.styles[pdoc->StyleIndexAt(pos.Position())].IsProtected()) {
while ((pos.Position() > 0) &&
- (vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()))
+ (vs.styles[pdoc->StyleIndexAt(pos.Position() - 1)].IsProtected()))
pos.Add(-1);
}
}