Author: mjansen
Date: Sun Jun 11 08:38:16 2017
New Revision: 74995
URL:
http://svn.reactos.org/svn/reactos?rev=74995&view=rev
Log:
[SHELL32] Don't try to follow a null pointer inside CFSDropTarget, this fixes a crash
in shell32:CFSFolder
Modified:
trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp
Modified: trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/droptarg…
==============================================================================
--- trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/droptargets/CFSDropTarget.cpp [iso-8859-1] Sun Jun 11
08:38:16 2017
@@ -192,6 +192,9 @@
HRESULT WINAPI CFSDropTarget::Initialize(LPWSTR PathTarget)
{
+ if (!PathTarget)
+ return E_UNEXPECTED;
+
cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
if (!cfShellIDList)
return E_FAIL;
@@ -199,6 +202,7 @@
sPathTarget = (WCHAR *)SHAlloc((wcslen(PathTarget) + 1) * sizeof(WCHAR));
if (!sPathTarget)
return E_OUTOFMEMORY;
+
wcscpy(sPathTarget, PathTarget);
return S_OK;