summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-10-02 12:39:08 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-10-02 12:39:08 +0100
commitf1ac9a4e59ba0e4c208d90ec7df07ad252829b5b (patch)
treed58309472e575aa551ec24b71416820a6d9d8b83
parentaf49ffb2b148e146feada9dea59342508414f122 (diff)
downloadlibdom-f1ac9a4e59ba0e4c208d90ec7df07ad252829b5b.tar.gz
libdom-f1ac9a4e59ba0e4c208d90ec7df07ad252829b5b.tar.bz2
html_document: Tag names of '' are invalid
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--src/html/html_document.c4
1 files changed, 4 insertions, 0 deletions
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, &params.name);
if (exc != DOM_NO_ERR)
return exc;