mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +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
1 changed files with 4 additions and 0 deletions
|
@ -192,6 +192,9 @@ CFSDropTarget::CFSDropTarget():
|
|||
|
||||
HRESULT WINAPI CFSDropTarget::Initialize(LPWSTR PathTarget)
|
||||
{
|
||||
if (!PathTarget)
|
||||
return E_UNEXPECTED;
|
||||
|
||||
cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
|
||||
if (!cfShellIDList)
|
||||
return E_FAIL;
|
||||
|
@ -199,6 +202,7 @@ HRESULT WINAPI CFSDropTarget::Initialize(LPWSTR PathTarget)
|
|||
sPathTarget = (WCHAR *)SHAlloc((wcslen(PathTarget) + 1) * sizeof(WCHAR));
|
||||
if (!sPathTarget)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
wcscpy(sPathTarget, PathTarget);
|
||||
|
||||
return S_OK;
|
||||
|
|
Loading…
Reference in a new issue