Skip to content

Commit

Permalink
Prevent segfault due to buffer overflows in addMultirowsForm
Browse files Browse the repository at this point in the history
Bug-Debian: #21
Bug-Debian: #26
  • Loading branch information
tats committed Aug 29, 2016
1 parent 7b88478 commit 4e46481
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions anchor.c
Expand Up @@ -685,6 +685,8 @@ addMultirowsForm(Buffer *buf, AnchorList *al)
a->hseq = a_form.hseq;
a->y = a_form.y;
a->end.pos = pos + ecol - col;
if (pos < 1 || a->end.pos >= l->size)
continue;

This comment has been minimized.

Copy link
@kcwu

kcwu Aug 29, 2016

Contributor

It would be great if add comments, which say this is workaround.

l->lineBuf[pos - 1] = '[';
l->lineBuf[a->end.pos] = ']';
for (k = pos; k < a->end.pos; k++)
Expand Down

0 comments on commit 4e46481

Please sign in to comment.