Commit 62a41d03 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite/reader: Return correct error for multiple colons in qualified name.

parent 3b83a446
......@@ -1838,7 +1838,7 @@ static HRESULT reader_parse_dtd(xmlreader *reader)
}
/* [11 NS] LocalPart ::= NCName */
static HRESULT reader_parse_local(xmlreader *reader, strval *local)
static HRESULT reader_parse_local(xmlreader *reader, strval *local, BOOL check_for_separator)
{
WCHAR *ptr;
UINT start;
......@@ -1860,6 +1860,9 @@ static HRESULT reader_parse_local(xmlreader *reader, strval *local)
ptr = reader_get_ptr(reader);
}
if (check_for_separator && *ptr == ':')
return NC_E_QNAMECOLON;
if (is_reader_pending(reader))
{
reader->resume[XmlReadResume_Local] = start;
......@@ -1898,7 +1901,7 @@ static HRESULT reader_parse_qname(xmlreader *reader, strval *prefix, strval *loc
if (reader->resume[XmlReadResume_Local])
{
hr = reader_parse_local(reader, local);
hr = reader_parse_local(reader, local, FALSE);
if (FAILED(hr)) return hr;
reader_init_strvalue(reader->resume[XmlReadResume_Name],
......@@ -1923,7 +1926,7 @@ static HRESULT reader_parse_qname(xmlreader *reader, strval *prefix, strval *loc
/* skip ':' */
reader_skipn(reader, 1);
hr = reader_parse_local(reader, local);
hr = reader_parse_local(reader, local, TRUE);
if (FAILED(hr)) return hr;
}
else
......
......@@ -1415,6 +1415,8 @@ static struct test_entry element_tests[] = {
{ "<a >", "a", "", S_OK },
{ "<a \r \t\n>", "a", "", S_OK },
{ "</a>", NULL, NULL, NC_E_QNAMECHARACTER },
{ "<a:b:c />", NULL, NULL, NC_E_QNAMECOLON },
{ "<:b:c />", NULL, NULL, NC_E_QNAMECHARACTER },
{ NULL }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment