Hi, Sorry for the delay. On Sat, Aug 22, 2026 at 09:24:22AM +0200, Andreas Kemnade wrote:
This also prevents crashes due to resource == NULL Examples can be found at https://www.pythontutorial.net/python-oop/ --- src/form.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/form.cc b/src/form.cc index 038b94f3..e9b9c984 100644 --- a/src/form.cc +++ b/src/form.cc @@ -538,7 +538,8 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize) } else if (!dStrAsciiCasecmp(type, "button")) { inp_type = DILLO_HTML_INPUT_BUTTON; if (value) {
We want to always create the button even with no value, so we need the resource.
- init_str = value; + label = value ? value : name ? name : "Submit";
From <https://html.spec.whatwg.org/multipage/input.html#button-state-(type=button)>:
If the element has a value attribute, the button's label must be the value of that attribute; otherwise, it must be the empty string.
I would also prefer to leave it empty to make it visible that the value is missing, otherwise you may not realize it has no value. I ended up merging the patch I wrote a while ago when the HTML fuzzer I'm testing triggered the same bug: https://git.dillo-browser.org/dillo/commit/?id=0a5e76decf21b042e6829a3616fe9... For the same reason, I want to avoid this:
- if (inp_type != DILLO_HTML_INPUT_UNKNOWN) { + if ((inp_type != DILLO_HTML_INPUT_UNKNOWN) && (resource || embed)) {
So it crashes when there is not resource and no embed. I added an assert: https://git.dillo-browser.org/dillo/commit/?id=784bedf88b37d70e283dd0490e3bd... There should be not more cases left in which we arrive with no resource or embed, but let me know otherwise. Thanks!, Rodrigo.