mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
[SHELL32]check for NULL pointer in CShellLink::SetDescription. patch by Joachim Henze. fixes Opera 12 installer CORE-5272
svn path=/trunk/; revision=72033
This commit is contained in:
@@ -1332,12 +1332,17 @@ HRESULT WINAPI CShellLink::SetDescription(LPCWSTR pszName)
|
||||
TRACE("(%p)->(desc=%s)\n", this, debugstr_w(pszName));
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, sDescription);
|
||||
sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
|
||||
(wcslen(pszName) + 1) * sizeof(WCHAR));
|
||||
if (!sDescription)
|
||||
return E_OUTOFMEMORY;
|
||||
if (pszName)
|
||||
{
|
||||
sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
|
||||
(wcslen(pszName) + 1) * sizeof(WCHAR));
|
||||
if (!sDescription)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
wcscpy(sDescription, pszName);
|
||||
wcscpy(sDescription, pszName);
|
||||
}
|
||||
else
|
||||
sDescription = NULL;
|
||||
bDirty = TRUE;
|
||||
|
||||
return S_OK;
|
||||
|
||||
Reference in New Issue
Block a user