aboutsummaryrefslogtreecommitdiffstats
path: root/form.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-17 12:10:30 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-17 12:10:30 +0000
commit807e8b7fbffca6dcaf5db40e35f05d05c5cf02d3 (patch)
tree3f87209456647ec269684747e08426009447953d /form.c
parentPrevent negative array index for selectnumber and textareanumber (diff)
downloadw3m-807e8b7fbffca6dcaf5db40e35f05d05c5cf02d3.tar.gz
w3m-807e8b7fbffca6dcaf5db40e35f05d05c5cf02d3.zip
Prevent segfault for formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/13
Diffstat (limited to '')
-rw-r--r--form.c2
1 files changed, 1 insertions, 1 deletions
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,