aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-11-15 10:40:28 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-11-19 12:26:11 +0000
commit3e63e222db9dc3b000b32f805fe6fb886f6b2cd4 (patch)
tree9cdf30e47973d17364ea71703f20fd599d0974ee
parentPrevent null pointer deref due to bad form id (diff)
downloadw3m-3e63e222db9dc3b000b32f805fe6fb886f6b2cd4.tar.gz
w3m-3e63e222db9dc3b000b32f805fe6fb886f6b2cd4.zip
Prevent deref null pointer in shiftAnchorPosition()
Bug-Debian: https://github.com/tats/w3m/issues/40 Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=a088e0263c48ba406a7ae0932a1ae64a25be7acd
-rw-r--r--anchor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/anchor.c b/anchor.c
index e006aea..ecb211d 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)