Prevent segfault due to buffer overflows in addMultirowsForm

Bug-Debian: https://github.com/tats/w3m/issues/21
Bug-Debian: https://github.com/tats/w3m/issues/26
This commit is contained in:
Tatsuya Kinoshita
2016-08-29 19:28:41 +09:00
parent 7b88478227
commit 4e464819dd

View File

@@ -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;
l->lineBuf[pos - 1] = '[';
l->lineBuf[a->end.pos] = ']';
for (k = pos; k < a->end.pos; k++)