Prevent dereference near-null pointer in formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/35
This commit is contained in:
3
form.c
3
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] = '*';
|
||||
|
Reference in New Issue
Block a user