Prevent segfault for formUpdateBuffer

Bug-Debian: https://github.com/tats/w3m/issues/13#issuecomment-242981906
This commit is contained in:
Tatsuya Kinoshita
2016-08-29 19:27:38 +09:00
parent 6445eb8378
commit 7b88478227

4
form.c
View File

@@ -483,8 +483,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
spos = a->start.pos;
epos = a->end.pos;
}
if (a->start.line != a->end.line || spos > epos || epos > l->len)
epos = spos;
if (a->start.line != a->end.line || spos > epos || epos >= l->len)
break;
pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col,
rows > 1,
form->type == FORM_INPUT_PASSWORD);