From 48155b5df04d2c2fc6ced9734ce82ca046b0092f Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Mon, 16 Jan 2012 00:06:14 +0100 Subject: [PATCH] shell32: Avoid crash on NULL pointer. --- dlls/shell32/assoc.c | 3 +++ dlls/shell32/tests/assoc.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index 0e6b6ba5e9e..942e7969350 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -84,6 +84,9 @@ static HRESULT WINAPI IQueryAssociations_fnQueryInterface( TRACE("(%p,%s,%p)\n",This, debugstr_guid(riid), ppvObj); + if (ppvObj == NULL) + return E_POINTER; + *ppvObj = NULL; if (IsEqualIID(riid, &IID_IUnknown) || diff --git a/dlls/shell32/tests/assoc.c b/dlls/shell32/tests/assoc.c index 00d04ffd29f..8d09ec2e2dd 100644 --- a/dlls/shell32/tests/assoc.c +++ b/dlls/shell32/tests/assoc.c @@ -54,6 +54,9 @@ static void test_IQueryAssociations_QueryInterface(void) IUnknown_Release(unk); } + hr = IUnknown_QueryInterface(qa, &IID_IUnknown, NULL); + ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr); + IQueryAssociations_Release(qa); } -- 2.11.4.GIT