diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-11-07 10:21:22 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-11-19 12:25:42 +0000 |
commit | 73397b6b7954971e3015b4f96b919ec90390e671 (patch) | |
tree | 4d7b5e4ebfba74e359ab1c4a4f7642790116d8fd | |
parent | Prevent crash after allocate string of negative size (diff) | |
download | w3m-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
-rw-r--r-- | form.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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] = '*'; |