Commit c3bd08b0 authored by Gijs Vermeulen's avatar Gijs Vermeulen Committed by Alexandre Julliard

wbemprox: Don't crash in IWbemClassObject::Put() when called with empty class object.

parent 11f20577
......@@ -460,6 +460,9 @@ static HRESULT WINAPI class_object_Put(
if ((hr = get_column_index( co->record->table, wszName, &index )) != S_OK) return hr;
return record_set_value( co->record, index, pVal );
}
if (!ec) return S_OK;
return put_propval( ec->query->view, co->index, wszName, pVal, Type );
}
......
......@@ -259,7 +259,7 @@ static void test_Win32_Service( IWbemServices *services )
{
BSTR class = SysAllocString( L"Win32_Service.Name=\"Spooler\"" ), empty = SysAllocString( L"" ), method;
IWbemClassObject *service, *out;
VARIANT state, retval;
VARIANT state, retval, classvar;
CIMTYPE type;
HRESULT hr;
......@@ -339,6 +339,13 @@ static void test_Win32_Service( IWbemServices *services )
hr = IWbemServices_GetObject( services, NULL, 0, NULL, &service, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( !!service, "expected non-NULL service\n" );
VariantInit(&classvar);
V_VT(&classvar) = VT_BSTR;
V_BSTR(&classvar) = SysAllocString(L"MyClass");
hr = IWbemClassObject_Put(service, L"__CLASS", 0, &classvar, 0);
ok( hr == S_OK, "got %08x\n", hr );
VariantClear(&classvar);
IWbemClassObject_Release( service );
service = NULL;
......
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