Module: wine Branch: master Commit: 48155b5df04d2c2fc6ced9734ce82ca046b0092f URL: http://source.winehq.org/git/wine.git/?a=commit;h=48155b5df04d2c2fc6ced9734c...
Author: Detlef Riekenberg wine.dev@web.de Date: Mon Jan 16 00:06:14 2012 +0100
shell32: Avoid crash on NULL pointer.
---
dlls/shell32/assoc.c | 3 +++ dlls/shell32/tests/assoc.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index 0e6b6ba..942e796 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 00d04ff..8d09ec2 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); }