diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-04 15:00:18 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-12-05 12:44:17 +0000 |
commit | d57c13282afc6b7dca029f992331b7afa0413356 (patch) | |
tree | 7948ab1cae734412bf397cb76303c050b44e504c /anchor.c | |
parent | Update ChangeLog (diff) | |
download | w3m-d57c13282afc6b7dca029f992331b7afa0413356.tar.gz w3m-d57c13282afc6b7dca029f992331b7afa0413356.zip |
Prevent negative array index for marks in shiftAnchorPosition()
Bug-Debian: https://github.com/tats/w3m/issues/62
Diffstat (limited to '')
-rw-r--r-- | anchor.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -551,7 +551,8 @@ shiftAnchorPosition(AnchorList *al, HmarkerList *hl, int line, int pos, break; if (a->start.pos > pos) { a->start.pos += shift; - if (hl && hl->marks && hl->marks[a->hseq].line == line) + if (hl && hl->marks && + a->hseq >= 0 && hl->marks[a->hseq].line == line) hl->marks[a->hseq].pos = a->start.pos; } if (a->end.pos >= pos) |