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

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2019-09-24 19:04:55 +02:00 committed by Alexandre Julliard
parent 5df86351f0
commit 78259fceb3
2 changed files with 28 additions and 4 deletions

View File

@ -149,6 +149,8 @@ static saxreader_feature get_saxreader_feature(const WCHAR *name)
return FeatureUnknown;
}
static const WCHAR empty_str;
struct bstrpool
{
BSTR *pool;
@ -1665,8 +1667,8 @@ static void libxmlStartElementNS(
&uri, &local, &element->qname, &This->IVBSAXAttributes_iface);
else
hr = ISAXContentHandler_startElement(handler->handler,
uri, SysStringLen(uri),
local, SysStringLen(local),
uri ? uri : &empty_str, SysStringLen(uri),
local ? local : &empty_str, SysStringLen(local),
element->qname, SysStringLen(element->qname),
&This->ISAXAttributes_iface);
@ -1739,8 +1741,8 @@ static void libxmlEndElementNS(
else
hr = ISAXContentHandler_endElement(
handler->handler,
uri, SysStringLen(uri),
local, SysStringLen(local),
uri ? uri : &empty_str, SysStringLen(uri),
local ? local : &empty_str, SysStringLen(local),
element->qname, SysStringLen(element->qname));
free_attribute_values(This);

View File

@ -1162,6 +1162,9 @@ static HRESULT WINAPI contentHandler_startPrefixMapping(
{
struct call_entry call;
ok(prefix != NULL, "prefix == NULL\n");
ok(uri != NULL, "uri == NULL\n");
init_call_entry(locator, &call);
call.id = CH_STARTPREFIXMAPPING;
call.arg1W = SysAllocStringLen(prefix, prefix_len);
@ -1177,6 +1180,8 @@ static HRESULT WINAPI contentHandler_endPrefixMapping(
{
struct call_entry call;
ok(prefix != NULL, "prefix == NULL\n");
init_call_entry(locator, &call);
call.id = CH_ENDPREFIXMAPPING;
call.arg1W = SysAllocStringLen(prefix, len);
@ -1197,6 +1202,10 @@ static HRESULT WINAPI contentHandler_startElement(
HRESULT hr;
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);
EXPECT_HR(hr, E_NOINTERFACE);
@ -1272,6 +1281,10 @@ static HRESULT WINAPI contentHandler_endElement(
{
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);
call.id = CH_ENDELEMENT;
call.arg1W = SysAllocStringLen(uri, uri_len);
@ -1289,6 +1302,8 @@ static HRESULT WINAPI contentHandler_characters(
{
struct call_entry call;
ok(chars != NULL, "chars == NULL\n");
init_call_entry(locator, &call);
call.id = CH_CHARACTERS;
call.arg1W = SysAllocStringLen(chars, len);
@ -1303,6 +1318,8 @@ static HRESULT WINAPI contentHandler_ignorableWhitespace(
{
struct call_entry call;
ok(chars != NULL, "chars == NULL\n");
init_call_entry(locator, &call);
call.id = CH_IGNORABLEWHITESPACE;
call.arg1W = SysAllocStringLen(chars, len);
@ -1318,6 +1335,9 @@ static HRESULT WINAPI contentHandler_processingInstruction(
{
struct call_entry call;
ok(target != NULL, "target == NULL\n");
ok(data != NULL, "data == NULL\n");
init_call_entry(locator, &call);
call.id = CH_PROCESSINGINSTRUCTION;
call.arg1W = SysAllocStringLen(target, target_len);
@ -1333,6 +1353,8 @@ static HRESULT WINAPI contentHandler_skippedEntity(
{
struct call_entry call;
ok(name != NULL, "name == NULL\n");
init_call_entry(locator, &call);
call.id = CH_SKIPPEDENTITY;
call.arg1W = SysAllocStringLen(name, len);