mirror of
https://github.com/reactos/reactos.git
synced 2024-08-19 18:02:55 +00:00
[SHELL32] Don't try to follow a null pointer inside CFSDropTarget, this fixes a crash in shell32:CFSFolder
svn path=/trunk/; revision=74995
This commit is contained in:
parent
178bc77a1f
commit
6c7fe2fb5f
|
@ -192,6 +192,9 @@ CFSDropTarget::CFSDropTarget():
|
||||||
|
|
||||||
HRESULT WINAPI CFSDropTarget::Initialize(LPWSTR PathTarget)
|
HRESULT WINAPI CFSDropTarget::Initialize(LPWSTR PathTarget)
|
||||||
{
|
{
|
||||||
|
if (!PathTarget)
|
||||||
|
return E_UNEXPECTED;
|
||||||
|
|
||||||
cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
|
cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
|
||||||
if (!cfShellIDList)
|
if (!cfShellIDList)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
@ -199,6 +202,7 @@ HRESULT WINAPI CFSDropTarget::Initialize(LPWSTR PathTarget)
|
||||||
sPathTarget = (WCHAR *)SHAlloc((wcslen(PathTarget) + 1) * sizeof(WCHAR));
|
sPathTarget = (WCHAR *)SHAlloc((wcslen(PathTarget) + 1) * sizeof(WCHAR));
|
||||||
if (!sPathTarget)
|
if (!sPathTarget)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
wcscpy(sPathTarget, PathTarget);
|
wcscpy(sPathTarget, PathTarget);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
Loading…
Reference in a new issue