Commit 13216442 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

shlwapi: Fix invalid usage of CompareString in PathCreateFromUrlW.

parent e2c06949
......@@ -3313,6 +3313,9 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath,
if (!pszUrl || !pszPath || !pcchPath || !*pcchPath)
return E_INVALIDARG;
if (lstrlenW(pszUrl) < 5)
return E_INVALIDARG;
if (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pszUrl, 5,
file_colon, 5) != CSTR_EQUAL)
return E_INVALIDARG;
......@@ -3354,9 +3357,8 @@ HRESULT WINAPI PathCreateFromUrlW(LPCWSTR pszUrl, LPWSTR pszPath,
src -= 1;
break;
case 2:
if (CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, src, 9,
localhost, 9) == CSTR_EQUAL &&
(src[9] == '/' || src[9] == '\\'))
if (lstrlenW(src) >= 10 && CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE,
src, 9, localhost, 9) == CSTR_EQUAL && (src[9] == '/' || src[9] == '\\'))
{
/* 'file://localhost/' + escaped DOS path */
src += 10;
......
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