From: Conor McCarthy <cmccarthy@codeweavers.com> Prevent access via garbage pointers in apps which assume success. --- dlls/wbemdisp/locator.c | 12 ++++++++++++ dlls/wbemdisp/main.c | 1 + 2 files changed, 13 insertions(+) diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c index 1ba775a9dde..c3ad6fa50a2 100644 --- a/dlls/wbemdisp/locator.c +++ b/dlls/wbemdisp/locator.c @@ -176,6 +176,7 @@ static HRESULT WINAPI property_QueryInterface( ISWbemProperty *iface, REFIID rii else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *obj = NULL; return E_NOINTERFACE; } ISWbemProperty_AddRef( iface ); @@ -375,6 +376,7 @@ static HRESULT WINAPI propertyset_QueryInterface( ISWbemPropertySet *iface, else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *obj = NULL; return E_NOINTERFACE; } ISWbemPropertySet_AddRef( iface ); @@ -587,6 +589,7 @@ static HRESULT WINAPI method_QueryInterface( ISWbemMethod *iface, REFIID riid, v else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemMethod_AddRef( iface ); @@ -810,6 +813,7 @@ static HRESULT WINAPI methodset_QueryInterface( ISWbemMethodSet *iface, REFIID r else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemMethodSet_AddRef( iface ); @@ -1040,6 +1044,7 @@ static HRESULT WINAPI object_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemObject_AddRef( iface ); @@ -1742,6 +1747,7 @@ static HRESULT WINAPI objectset_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemObjectSet_AddRef( iface ); @@ -2009,6 +2015,7 @@ static HRESULT WINAPI enumvar_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } IEnumVARIANT_AddRef( iface ); @@ -2140,6 +2147,7 @@ static HRESULT WINAPI services_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemServices_AddRef( iface ); @@ -2645,6 +2653,7 @@ static HRESULT WINAPI locator_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemLocator_AddRef( iface ); @@ -2884,6 +2893,7 @@ static HRESULT WINAPI security_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemSecurity_AddRef( iface ); @@ -3096,6 +3106,7 @@ static HRESULT WINAPI namedvalue_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemNamedValue_AddRef( iface ); @@ -3272,6 +3283,7 @@ static HRESULT WINAPI namedvalueset_QueryInterface( else { WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *ppvObject = NULL; return E_NOINTERFACE; } ISWbemNamedValueSet_AddRef( iface ); diff --git a/dlls/wbemdisp/main.c b/dlls/wbemdisp/main.c index b71efdb6da0..5bc39007344 100644 --- a/dlls/wbemdisp/main.c +++ b/dlls/wbemdisp/main.c @@ -209,6 +209,7 @@ static HRESULT WINAPI factory_QueryInterface( IClassFactory *iface, REFIID riid, return S_OK; } WARN( "interface %s not implemented\n", debugstr_guid(riid) ); + *obj = NULL; return E_NOINTERFACE; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11711