Commit 78259fce authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Don't return NULL namespace and local name in saxreader callbacks.

parent 5df86351
...@@ -149,6 +149,8 @@ static saxreader_feature get_saxreader_feature(const WCHAR *name) ...@@ -149,6 +149,8 @@ static saxreader_feature get_saxreader_feature(const WCHAR *name)
return FeatureUnknown; return FeatureUnknown;
} }
static const WCHAR empty_str;
struct bstrpool struct bstrpool
{ {
BSTR *pool; BSTR *pool;
...@@ -1665,8 +1667,8 @@ static void libxmlStartElementNS( ...@@ -1665,8 +1667,8 @@ static void libxmlStartElementNS(
&uri, &local, &element->qname, &This->IVBSAXAttributes_iface); &uri, &local, &element->qname, &This->IVBSAXAttributes_iface);
else else
hr = ISAXContentHandler_startElement(handler->handler, hr = ISAXContentHandler_startElement(handler->handler,
uri, SysStringLen(uri), uri ? uri : &empty_str, SysStringLen(uri),
local, SysStringLen(local), local ? local : &empty_str, SysStringLen(local),
element->qname, SysStringLen(element->qname), element->qname, SysStringLen(element->qname),
&This->ISAXAttributes_iface); &This->ISAXAttributes_iface);
...@@ -1739,8 +1741,8 @@ static void libxmlEndElementNS( ...@@ -1739,8 +1741,8 @@ static void libxmlEndElementNS(
else else
hr = ISAXContentHandler_endElement( hr = ISAXContentHandler_endElement(
handler->handler, handler->handler,
uri, SysStringLen(uri), uri ? uri : &empty_str, SysStringLen(uri),
local, SysStringLen(local), local ? local : &empty_str, SysStringLen(local),
element->qname, SysStringLen(element->qname)); element->qname, SysStringLen(element->qname));
free_attribute_values(This); free_attribute_values(This);
......
...@@ -1162,6 +1162,9 @@ static HRESULT WINAPI contentHandler_startPrefixMapping( ...@@ -1162,6 +1162,9 @@ static HRESULT WINAPI contentHandler_startPrefixMapping(
{ {
struct call_entry call; struct call_entry call;
ok(prefix != NULL, "prefix == NULL\n");
ok(uri != NULL, "uri == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_STARTPREFIXMAPPING; call.id = CH_STARTPREFIXMAPPING;
call.arg1W = SysAllocStringLen(prefix, prefix_len); call.arg1W = SysAllocStringLen(prefix, prefix_len);
...@@ -1177,6 +1180,8 @@ static HRESULT WINAPI contentHandler_endPrefixMapping( ...@@ -1177,6 +1180,8 @@ static HRESULT WINAPI contentHandler_endPrefixMapping(
{ {
struct call_entry call; struct call_entry call;
ok(prefix != NULL, "prefix == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_ENDPREFIXMAPPING; call.id = CH_ENDPREFIXMAPPING;
call.arg1W = SysAllocStringLen(prefix, len); call.arg1W = SysAllocStringLen(prefix, len);
...@@ -1197,6 +1202,10 @@ static HRESULT WINAPI contentHandler_startElement( ...@@ -1197,6 +1202,10 @@ static HRESULT WINAPI contentHandler_startElement(
HRESULT hr; HRESULT hr;
int len; int len;
ok(uri != NULL, "uri == NULL\n");
ok(localname != NULL, "localname == NULL\n");
ok(qname != NULL, "qname == NULL\n");
hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (void**)&mxattr); hr = ISAXAttributes_QueryInterface(saxattr, &IID_IMXAttributes, (void**)&mxattr);
EXPECT_HR(hr, E_NOINTERFACE); EXPECT_HR(hr, E_NOINTERFACE);
...@@ -1272,6 +1281,10 @@ static HRESULT WINAPI contentHandler_endElement( ...@@ -1272,6 +1281,10 @@ static HRESULT WINAPI contentHandler_endElement(
{ {
struct call_entry call; struct call_entry call;
ok(uri != NULL, "uri == NULL\n");
ok(localname != NULL, "localname == NULL\n");
ok(qname != NULL, "qname == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_ENDELEMENT; call.id = CH_ENDELEMENT;
call.arg1W = SysAllocStringLen(uri, uri_len); call.arg1W = SysAllocStringLen(uri, uri_len);
...@@ -1289,6 +1302,8 @@ static HRESULT WINAPI contentHandler_characters( ...@@ -1289,6 +1302,8 @@ static HRESULT WINAPI contentHandler_characters(
{ {
struct call_entry call; struct call_entry call;
ok(chars != NULL, "chars == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_CHARACTERS; call.id = CH_CHARACTERS;
call.arg1W = SysAllocStringLen(chars, len); call.arg1W = SysAllocStringLen(chars, len);
...@@ -1303,6 +1318,8 @@ static HRESULT WINAPI contentHandler_ignorableWhitespace( ...@@ -1303,6 +1318,8 @@ static HRESULT WINAPI contentHandler_ignorableWhitespace(
{ {
struct call_entry call; struct call_entry call;
ok(chars != NULL, "chars == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_IGNORABLEWHITESPACE; call.id = CH_IGNORABLEWHITESPACE;
call.arg1W = SysAllocStringLen(chars, len); call.arg1W = SysAllocStringLen(chars, len);
...@@ -1318,6 +1335,9 @@ static HRESULT WINAPI contentHandler_processingInstruction( ...@@ -1318,6 +1335,9 @@ static HRESULT WINAPI contentHandler_processingInstruction(
{ {
struct call_entry call; struct call_entry call;
ok(target != NULL, "target == NULL\n");
ok(data != NULL, "data == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_PROCESSINGINSTRUCTION; call.id = CH_PROCESSINGINSTRUCTION;
call.arg1W = SysAllocStringLen(target, target_len); call.arg1W = SysAllocStringLen(target, target_len);
...@@ -1333,6 +1353,8 @@ static HRESULT WINAPI contentHandler_skippedEntity( ...@@ -1333,6 +1353,8 @@ static HRESULT WINAPI contentHandler_skippedEntity(
{ {
struct call_entry call; struct call_entry call;
ok(name != NULL, "name == NULL\n");
init_call_entry(locator, &call); init_call_entry(locator, &call);
call.id = CH_SKIPPEDENTITY; call.id = CH_SKIPPEDENTITY;
call.arg1W = SysAllocStringLen(name, len); call.arg1W = SysAllocStringLen(name, len);
......
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