[SHELLFOLDERS] Gracefully handle NULL pidl in CDrivesFolder::BindToObject. CORE-16403
authorThomas Faber <thomas.faber@reactos.org>
Sun, 8 Sep 2019 13:40:46 +0000 (15:40 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 29 Sep 2019 10:42:26 +0000 (12:42 +0200)
Fixes one of many crashes in shell32_winetest:shlfolder.

dll/win32/shell32/folders/CDrivesFolder.cpp

index ccb0b52..d8c35a7 100644 (file)
@@ -536,6 +536,9 @@ HRESULT WINAPI CDrivesFolder::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcRese
     TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", this,
           pidl, pbcReserved, shdebugstr_guid(&riid), ppvOut);
 
+    if (!pidl)
+        return E_INVALIDARG;
+
     if (_ILIsSpecialFolder(pidl))
         return m_regFolder->BindToObject(pidl, pbcReserved, riid, ppvOut);