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