From 807e8b7fbffca6dcaf5db40e35f05d05c5cf02d3 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 17 Aug 2016 21:10:30 +0900 Subject: Prevent segfault for formUpdateBuffer Bug-Debian: https://github.com/tats/w3m/issues/13 --- form.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'form.c') diff --git a/form.c b/form.c index da115fa..805505f 100644 --- a/form.c +++ b/form.c @@ -481,7 +481,7 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form) spos = a->start.pos; epos = a->end.pos; } - if (a->start.line != a->end.line || spos > epos) + if (a->start.line != a->end.line || spos > epos || epos > l->len) epos = spos; pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col, rows > 1, -- cgit v1.2.3