Prevent dereference near-null pointer in formUpdateBuffer
Bug-Debian: https://github.com/tats/w3m/issues/35
This commit is contained in:
1 parent
af592aa5f1
commit
e2c7ecec6f
1 file changed
+2
-1
@@ -442,7 +442,8 @@ formUpdateBuffer(Anchor *a, Buffer *buf, FormItemList *form)
|
|||||||
switch (form->type) {
|
switch (form->type) {
|
||||||
case FORM_INPUT_CHECKBOX:
|
case FORM_INPUT_CHECKBOX:
|
||||||
case FORM_INPUT_RADIO:
|
case FORM_INPUT_RADIO:
|
||||||
if (spos >= buf->currentLine->len || spos < 0)
|
if (buf->currentLine == NULL ||
|
||||||
|
spos >= buf->currentLine->len || spos < 0)
|
||||||
break;
|
break;
|
||||||
if (form->checked)
|
if (form->checked)
|
||||||
buf->currentLine->lineBuf[spos] = '*';
|
buf->currentLine->lineBuf[spos] = '*';
|
||||||
|
|||||||
Reference in new issue
Block a user