Commit 3c6cbc2f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shell32: Don't access uninitialized buffer (Coverity).

parent 333c5bd9
......@@ -4735,6 +4735,7 @@ HRESULT WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD flags, HANDLE t
hr = E_INVALIDARG;
break;
case CSIDL_Type_NonExistent:
*tempW = 0;
hr = S_FALSE;
break;
case CSIDL_Type_WindowsPath:
......@@ -4785,14 +4786,18 @@ HRESULT WINAPI SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD flags, HANDLE t
break;
}
if (FAILED(hr))
goto failed;
/* Expand environment strings if necessary */
if (*tempW == '%')
{
hr = _SHExpandEnvironmentStrings(tempW, pathW);
else
strcpyW(pathW, tempW);
if (FAILED(hr))
goto failed;
}
else
strcpyW(pathW, tempW);
/* if we don't care about existing directories we are ready */
if (flags & KF_FLAG_DONT_VERIFY) goto done;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment