From a66bee2837e4bed6f5940bad22667a4b5d4a6603 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 8 Sep 2019 15:40:46 +0200 Subject: [PATCH] [SHELLFOLDERS] Gracefully handle NULL pidl in CDrivesFolder::BindToObject. CORE-16403 Fixes one of many crashes in shell32_winetest:shlfolder. --- dll/win32/shell32/folders/CDrivesFolder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp b/dll/win32/shell32/folders/CDrivesFolder.cpp index ccb0b52883c..d8c35a79150 100644 --- a/dll/win32/shell32/folders/CDrivesFolder.cpp +++ b/dll/win32/shell32/folders/CDrivesFolder.cpp @@ -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);