[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:
Christoph von Wittich
2016-07-28 15:12:23 +00:00
parent 372d5c10c4
commit de1219eb52
+10 -5
View File
@@ -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;