Skip to content

Commit

Permalink
Prevent deref null pointer in shiftAnchorPosition()
Browse files Browse the repository at this point in the history
Bug-Debian: #40
  • Loading branch information
tats committed Nov 15, 2016
1 parent 06caca1 commit a088e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion anchor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a088e02

Please sign in to comment.