From a088e0263c48ba406a7ae0932a1ae64a25be7acd Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Tue, 15 Nov 2016 19:40:28 +0900 Subject: Prevent deref null pointer in shiftAnchorPosition() Bug-Debian: https://github.com/tats/w3m/issues/40 --- anchor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'anchor.c') diff --git a/anchor.c b/anchor.c index fa8d3eb..10d6c1c 100644 --- a/anchor.c +++ b/anchor.c @@ -551,7 +551,7 @@ shiftAnchorPosition(AnchorList *al, HmarkerList *hl, int line, int pos, break; if (a->start.pos > pos) { a->start.pos += shift; - if (hl->marks[a->hseq].line == line) + if (hl && hl->marks && hl->marks[a->hseq].line == line) hl->marks[a->hseq].pos = a->start.pos; } if (a->end.pos >= pos) -- cgit v1.2.3