aboutsummaryrefslogtreecommitdiffstats
path: root/form.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-08-24 10:05:31 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-08-24 10:05:58 +0000
commit4a8d16fc8d08206dd7142435054ee38ff41805b7 (patch)
tree9d11a8382afd328e244e7ddfb6ceb491cae05c2d /form.c
parentTruncate max_width for renderTable (diff)
downloadw3m-4a8d16fc8d08206dd7142435054ee38ff41805b7.tar.gz
w3m-4a8d16fc8d08206dd7142435054ee38ff41805b7.zip
Prevent segfault for formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/22
Diffstat (limited to 'form.c')
-rw-r--r--form.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/form.c b/form.c
index 805505f..b56347b 100644
--- a/form.c
+++ b/form.c
@@ -461,6 +461,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
#endif /* MENU_SELECT */
p = form->value->ptr;
l = buf->currentLine;
+ if (!l)
+ break;
if (form->type == FORM_TEXTAREA) {
int n = a->y - buf->currentLine->linenumber;
if (n > 0)