diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-10 13:30:36 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-12-10 13:30:36 +0000 |
commit | 1978455e2ed01699789e8374d29515b74b867b2b (patch) | |
tree | 95d1b5abe82391e9692e17f548013b7ba6ebed38 | |
parent | Prevent overflow beyond the end of string in wtf_parse1() (diff) | |
download | w3m-1978455e2ed01699789e8374d29515b74b867b2b.tar.gz w3m-1978455e2ed01699789e8374d29515b74b867b2b.zip |
Prevent negative array index for realColumn in calcPosition()
Bug-Debian: https://github.com/tats/w3m/issues/69
Diffstat (limited to '')
-rw-r--r-- | etc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -498,7 +498,7 @@ calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode) static char *prevl = NULL; int i, j; - if (l == NULL || len == 0) + if (l == NULL || len == 0 || pos < 0) return bpos; if (l == prevl && mode == CP_AUTO) { if (pos <= len) |