Author: cwittich
Date: Thu Jul 28 15:12:23 2016
New Revision: 72033
URL:
http://svn.reactos.org/svn/reactos?rev=72033&view=rev
Log:
[SHELL32]check for NULL pointer in CShellLink::SetDescription. patch by Joachim Henze.
fixes Opera 12 installer CORE-5272
Modified:
trunk/reactos/dll/win32/shell32/CShellLink.cpp
Modified: trunk/reactos/dll/win32/shell32/CShellLink.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CShellLi…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CShellLink.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CShellLink.cpp [iso-8859-1] Thu Jul 28 15:12:23 2016
@@ -1332,12 +1332,17 @@
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;
-
- wcscpy(sDescription, pszName);
+ if (pszName)
+ {
+ sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
+ (wcslen(pszName) + 1) * sizeof(WCHAR));
+ if (!sDescription)
+ return E_OUTOFMEMORY;
+
+ wcscpy(sDescription, pszName);
+ }
+ else
+ sDescription = NULL;
bDirty = TRUE;
return S_OK;