aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-09-25 07:02:15 +1000
committernyamatongwe <devnull@localhost>2010-09-25 07:02:15 +1000
commit18dd7b2eaa6d7228328a6a5dbac3306305841ad6 (patch)
tree6c29d1f07c944bac8837b04b41262c70c6e033d6 /src
parentb458c22e5421f4d0fd23cdf14c072d132a820937 (diff)
downloadscintilla-mirror-18dd7b2eaa6d7228328a6a5dbac3306305841ad6.tar.gz
Bug #3075074 fixed. AddMark and AddMarkSet need to check line arg
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 8ebd407d8..bae33b97e 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -194,7 +194,7 @@ int Document::GetMark(int line) {
}
int Document::AddMark(int line, int markerNum) {
- if (line <= LinesTotal()) {
+ if (line >= 0 && line <= LinesTotal()) {
int prev = static_cast<LineMarkers *>(perLineData[ldMarkers])->
AddMark(line, markerNum, LinesTotal());
DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line);
@@ -206,6 +206,9 @@ int Document::AddMark(int line, int markerNum) {
}
void Document::AddMarkSet(int line, int valueSet) {
+ if (line < 0 || line > LinesTotal()) {
+ return;
+ }
unsigned int m = valueSet;
for (int i = 0; m; i++, m >>= 1)
if (m & 1)