aboutsummaryrefslogtreecommitdiffstats
path: root/form.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2016-11-07 10:21:22 +0000
committerTatsuya Kinoshita <tats@debian.org>2016-11-19 12:25:42 +0000
commit73397b6b7954971e3015b4f96b919ec90390e671 (patch)
tree4d7b5e4ebfba74e359ab1c4a4f7642790116d8fd /form.c
parentPrevent crash after allocate string of negative size (diff)
downloadw3m-73397b6b7954971e3015b4f96b919ec90390e671.tar.gz
w3m-73397b6b7954971e3015b4f96b919ec90390e671.zip
Prevent dereference near-null pointer in formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/35 Origin: https://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=e2c7ecec6f9b730ad3c9bf8c8df9212970f183d7
Diffstat (limited to 'form.c')
-rw-r--r--form.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/form.c b/form.c
index de7a4d9..1aaaf19d 100644
--- a/form.c
+++ b/form.c
@@ -442,7 +442,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
switch (form->type) {
case FORM_INPUT_CHECKBOX:
case FORM_INPUT_RADIO:
- if (spos >= buf->currentLine->len || spos < 0)
+ if (buf->currentLine == NULL ||
+ spos >= buf->currentLine->len || spos < 0)
break;
if (form->checked)
buf->currentLine->lineBuf[spos] = '*';