aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-29 10:27:38 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-29 10:29:19 +0000
commit7b88478227978a8d673b4dd0e05eee410cc33330 (patch)
tree1d728606de0b68b1173363bc9c8d0731c7946045
parentUpdate ChangeLog (diff)
downloadw3m-7b88478227978a8d673b4dd0e05eee410cc33330.tar.gz
w3m-7b88478227978a8d673b4dd0e05eee410cc33330.zip
Prevent segfault for formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/13#issuecomment-242981906
-rw-r--r--form.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/form.c b/form.c
index b56347b..20b7310 100644
--- a/form.c
+++ b/form.c
@@ -483,8 +483,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 > l->len)
- epos = spos;
+ if (a->start.line != a->end.line || spos > epos || epos >= l->len)
+ break;
pos = form_update_line(l, &p, spos, epos, COLPOS(l, epos) - col,
rows > 1,
form->type == FORM_INPUT_PASSWORD);