aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2017-12-26 21:43:52 +0000
committerTatsuya Kinoshita <tats@debian.org>2017-12-26 21:43:52 +0000
commit7fdc83b0364005a0b5ed869230dd81752ba022e8 (patch)
tree608bd33f93aca3db2514317558531f9c7b4a5db2
parentTypo fix in fusage() (diff)
downloadw3m-7fdc83b0364005a0b5ed869230dd81752ba022e8.tar.gz
w3m-7fdc83b0364005a0b5ed869230dd81752ba022e8.zip
Prevent invalid columnPos() call in formUpdateBuffer()
Bug-Debian: https://github.com/tats/w3m/issues/89
-rw-r--r--form.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/form.c b/form.c
index cc5e3d2..bc14d39 100644
--- a/form.c
+++ b/form.c
@@ -482,6 +482,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
rows = form->rows ? form->rows : 1;
col = COLPOS(l, a->start.pos);
for (c_rows = 0; c_rows < rows; c_rows++, l = l->next) {
+ if (l == NULL)
+ break;
if (rows > 1) {
pos = columnPos(l, col);
a = retrieveAnchor(buf->formitem, l->linenumber, pos);