aboutsummaryrefslogtreecommitdiffstats
path: root/form.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-15 11:07:56 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-15 11:42:27 +0000
commit9f0bdcfdf061db3520bd1f112bdc5e83acdec4be (patch)
treee78ec9a80373529fa371d6fa7544c873965abb02 /form.c
parentUpdate ChangeLog (diff)
downloadw3m-9f0bdcfdf061db3520bd1f112bdc5e83acdec4be.tar.gz
w3m-9f0bdcfdf061db3520bd1f112bdc5e83acdec4be.zip
Prevent segfault for formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/9 Bug-Debian: https://github.com/tats/w3m/issues/10
Diffstat (limited to '')
-rw-r--r--form.c2
1 files changed, 2 insertions, 0 deletions
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);