From 73397b6b7954971e3015b4f96b919ec90390e671 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Mon, 7 Nov 2016 19:21:22 +0900 Subject: 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 --- form.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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] = '*'; -- cgit v1.2.3