From 9f0bdcfdf061db3520bd1f112bdc5e83acdec4be Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Mon, 15 Aug 2016 20:07:56 +0900 Subject: Prevent segfault for formUpdateBuffer Bug-Debian: https://github.com/tats/w3m/issues/9 Bug-Debian: https://github.com/tats/w3m/issues/10 --- form.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'form.c') diff --git a/form.c b/form.c index 62b568e..87a5d49 100644 --- a/form.c +++ b/form.c @@ -477,6 +477,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 = spos; pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col, rows > 1, form->type == FORM_INPUT_PASSWORD); -- cgit v1.2.3