Commit b7e6906c authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Validated attribute name.

parent 8e57a419
......@@ -458,7 +458,7 @@ static HRESULT WINAPI domelem_getAttribute(
{
domelem *This = impl_from_IXMLDOMElement( iface );
xmlNodePtr element;
xmlChar *xml_name, *xml_value;
xmlChar *xml_name, *xml_value = NULL;
HRESULT hr = S_FALSE;
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(name), value);
......@@ -474,7 +474,12 @@ static HRESULT WINAPI domelem_getAttribute(
V_VT(value) = VT_NULL;
xml_name = xmlChar_from_wchar( name );
xml_value = xmlGetNsProp(element, xml_name, NULL);
if(!xmlValidateNameValue(xml_name))
hr = E_FAIL;
else
xml_value = xmlGetNsProp(element, xml_name, NULL);
HeapFree(GetProcessHeap(), 0, xml_name);
if(xml_value)
{
......
......@@ -719,7 +719,7 @@ static void test_domnode( void )
V_VT(&var) = VT_I4;
V_I4(&var) = 0x1234;
r = IXMLDOMElement_getAttribute( element, str, &var );
ok( r == S_FALSE, "getAttribute ret %08x\n", r );
ok( r == E_FAIL, "getAttribute ret %08x\n", r );
ok( V_VT(&var) == VT_NULL, "vt = %x\n", V_VT(&var));
VariantClear(&var);
SysFreeString( str );
......
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