Prevent segfault for formUpdateBuffer

Bug-Debian: https://github.com/tats/w3m/issues/22
This commit is contained in:
Tatsuya Kinoshita
2016-08-24 19:05:31 +09:00
parent b910f0966d
commit 4a8d16fc8d

2
form.c
View File

@@ -461,6 +461,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
#endif /* MENU_SELECT */
p = form->value->ptr;
l = buf->currentLine;
if (!l)
break;
if (form->type == FORM_TEXTAREA) {
int n = a->y - buf->currentLine->linenumber;
if (n > 0)