summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2014-01-24 12:32:52 (GMT)
committer Vincent Sanders <vince@netsurf-browser.org>2014-01-24 12:32:52 (GMT)
commit6e31ecb214b26cc9d1d41e7b196d4cc57b4494b4 (patch)
treedd3feab133ee1f294b9adfdb010c6a02fcf40a89
parent4ceb50c64c639c07fdc0a23ded435ceffd8462e7 (diff)
downloadlibdom-6e31ecb214b26cc9d1d41e7b196d4cc57b4494b4.tar.gz
libdom-6e31ecb214b26cc9d1d41e7b196d4cc57b4494b4.tar.bz2
ensure dom_implementation_create_document_type() parameters are present (coverity 1127076)
-rw-r--r--src/core/implementation.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/implementation.c b/src/core/implementation.c
index 7380771..6f8db45 100644
--- a/src/core/implementation.c
+++ b/src/core/implementation.c
@@ -67,13 +67,15 @@ dom_exception dom_implementation_create_document_type(
dom_string *public_id_s = NULL, *system_id_s = NULL;
dom_exception err;
- if (qname != NULL) {
- err = dom_string_create((const uint8_t *) qname,
- strlen(qname), &qname_s);
- if (err != DOM_NO_ERR)
- return err;
+ if (qname == NULL) {
+ return DOM_INVALID_CHARACTER_ERR;
}
+ err = dom_string_create((const uint8_t *) qname,
+ strlen(qname), &qname_s);
+ if (err != DOM_NO_ERR)
+ return err;
+
err = _dom_namespace_split_qname(qname_s, &prefix, &lname);
if (err != DOM_NO_ERR) {
dom_string_unref(qname_s);