msxml3: Validated attribute name.

This commit is contained in:
Alistair Leslie-Hughes 2008-02-01 20:45:02 +11:00 committed by Alexandre Julliard
parent 8e57a41913
commit b7e6906c2d
2 changed files with 8 additions and 3 deletions

View File

@ -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)
{

View File

@ -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 );