diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-11-07 10:21:22 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2016-11-07 10:21:22 +0000 |
commit | e2c7ecec6f9b730ad3c9bf8c8df9212970f183d7 (patch) | |
tree | c58c13c86830a65220c2ccbc1047a0132d04ddf4 | |
parent | Prevent crash after allocate string of negative size (diff) | |
download | w3m-e2c7ecec6f9b730ad3c9bf8c8df9212970f183d7.tar.gz w3m-e2c7ecec6f9b730ad3c9bf8c8df9212970f183d7.zip |
Prevent dereference near-null pointer in formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/35
Diffstat (limited to '')
-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] = '*'; |