diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-12-10 13:30:36 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2017-01-06 13:14:58 +0000 |
commit | 7c06ceb2105239edff38e14307cec1ac0ef643aa (patch) | |
tree | b6ad8c3a05dff03943e7227cbe20efc093931496 | |
parent | Prevent heap-buffer-overflow in Strnew_size() (diff) | |
download | w3m-7c06ceb2105239edff38e14307cec1ac0ef643aa.tar.gz w3m-7c06ceb2105239edff38e14307cec1ac0ef643aa.zip |
Prevent negative array index for realColumn in calcPosition()
Bug-Debian: https://github.com/tats/w3m/issues/69
Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=1978455e2ed01699789e8374d29515b74b867b2b
-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) |