diff options
author | Vincent Sanders <vince@kyllikki.org> | 2024-02-25 10:28:03 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2024-02-25 10:28:03 +0000 |
commit | bce0aa6fc9250395a899996b5e9067b4f370c40d (patch) | |
tree | 6c97c5a6d8136348932a308474150db2c999e86b /content/handlers | |
parent | f88e12f9d68334e2abd911175d2560bb693c3ff5 (diff) | |
download | netsurf-bce0aa6fc9250395a899996b5e9067b4f370c40d.tar.gz netsurf-bce0aa6fc9250395a899996b5e9067b4f370c40d.tar.bz2 |
Do not crash if radio form has no name attribute
Diffstat (limited to 'content/handlers')
-rw-r--r-- | content/handlers/html/form.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c index afa40ac2e..8c8120877 100644 --- a/content/handlers/html/form.c +++ b/content/handlers/html/form.c @@ -2002,13 +2002,18 @@ void form_radio_set(struct form_control *radio) if (radio->selected) return; - for (control = radio->form->controls; control; - control = control->next) { + for (control = radio->form->controls; + control != NULL; + control = control->next) { if (control->type != GADGET_RADIO) continue; + if (control == radio) continue; - if (strcmp(control->name, radio->name) != 0) + + if ((control->name != NULL) && + (radio->name != NULL) && + strcmp(control->name, radio->name) != 0) continue; if (control->selected) { |