From 1978455e2ed01699789e8374d29515b74b867b2b Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Sat, 10 Dec 2016 22:30:36 +0900 Subject: Prevent negative array index for realColumn in calcPosition() Bug-Debian: https://github.com/tats/w3m/issues/69 --- etc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc.c') diff --git a/etc.c b/etc.c index dcc6edd..37c4f15 100644 --- a/etc.c +++ b/etc.c @@ -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) -- cgit v1.2.3