mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
- avoid crash, pszExt is null when creating a link to a file without extension
svn path=/trunk/; revision=38230
This commit is contained in:
parent
aa10663d0b
commit
aecdd2f5e9
1 changed files with 2 additions and 4 deletions
|
@ -1202,11 +1202,9 @@ DoCreateLink(
|
|||
if (StrRetToBufW(&strFile, This->dcm.apidl[0], szPath, MAX_PATH) != S_OK)
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
pszExt = wcsrchr(szPath, L'.');
|
||||
pszExt[0] = 0;
|
||||
|
||||
if (!wcsicmp(pszExt + 1, szLnk))
|
||||
if (pszExt && !wcsicmp(pszExt + 1, szLnk))
|
||||
{
|
||||
if (!GetUniqueFileName(szPath, pszExt + 1, szTarget, TRUE))
|
||||
return E_FAIL;
|
||||
|
@ -1231,7 +1229,7 @@ DoCreateLink(
|
|||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
pszExt[0] = '.';
|
||||
|
||||
if (SUCCEEDED(IShellLinkW_SetPath(nLink, szPath)))
|
||||
{
|
||||
if (SUCCEEDED(IShellLinkW_QueryInterface(nLink, &IID_IPersistFile, (LPVOID*)&ipf)))
|
||||
|
|
Loading…
Reference in a new issue