Commit 36117911 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Avoid SysStringLen() testing for an empty string in ::createNode().

parent 43d9c9bb
......@@ -1368,7 +1368,7 @@ static HRESULT WINAPI domdoc_createNode(
case NODE_ATTRIBUTE:
case NODE_ENTITY_REFERENCE:
case NODE_PROCESSING_INSTRUCTION:
if (!name || SysStringLen(name) == 0) return E_FAIL;
if (!name || *name == 0) return E_FAIL;
default:
break;
}
......
......@@ -1988,6 +1988,17 @@ static void test_create(void)
if( SUCCEEDED(r) ) IXMLDOMNode_Release( node );
SysFreeString(str);
/* a name is required for attribute, try a BSTR with first null wchar */
V_VT(&var) = VT_I1;
V_I1(&var) = NODE_ATTRIBUTE;
str = SysAllocString( szstr1 );
str[0] = 0;
node = (IXMLDOMNode*)0x1;
r = IXMLDOMDocument_createNode( doc, var, str, NULL, &node );
ok( r == E_FAIL, "returns %08x\n", r );
ok( node == (void*)0x1, "expected same ptr, got %p\n", node);
SysFreeString(str);
/* NODE_PROCESSING_INSTRUCTION */
V_VT(&var) = VT_I1;
V_I1(&var) = NODE_PROCESSING_INSTRUCTION;
......
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