From f1ac9a4e59ba0e4c208d90ec7df07ad252829b5b Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Fri, 2 Oct 2020 12:39:08 +0100 Subject: html_document: Tag names of '' are invalid Signed-off-by: Daniel Silverstone --- src/html/html_document.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/html/html_document.c b/src/html/html_document.c index d978327..5d06e80 100644 --- a/src/html/html_document.c +++ b/src/html/html_document.c @@ -536,6 +536,10 @@ _dom_html_document_create_element_internal( dom_exception exc; struct dom_html_element_create_params params; + /* If the input tag name is empty, this is an 'invalid character' error */ + if (dom_string_length(in_tag_name) == 0) + return DOM_INVALID_CHARACTER_ERR; + exc = dom_string_toupper(in_tag_name, true, ¶ms.name); if (exc != DOM_NO_ERR) return exc; -- cgit v1.2.3