Commit 32fda211 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

shlwapi: Check an argument to UrlEscapeA.

parent 0da7c8f4
......@@ -480,6 +480,11 @@ static void test_UrlEscape(void)
}
size = 1;
ret = UrlEscapeA("/woningplan/woonkamer basis.swf", empty_string, NULL, URL_ESCAPE_SPACES_ONLY);
ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG);
ok(size == 1, "got %d, expected %d\n", size, 1);
size = 1;
ret = UrlEscapeA("/woningplan/woonkamer basis.swf", empty_string, &size, URL_ESCAPE_SPACES_ONLY);
todo_wine {
ok(ret == E_POINTER, "got %x, expected %x\n", ret, E_POINTER);
......
......@@ -843,6 +843,9 @@ HRESULT WINAPI UrlEscapeA(
HRESULT ret;
DWORD lenW = sizeof(bufW)/sizeof(WCHAR), lenA;
if (!pcchEscaped)
return E_INVALIDARG;
if(!RtlCreateUnicodeStringFromAsciiz(&urlW, pszUrl))
return E_INVALIDARG;
if((ret = UrlEscapeW(urlW.Buffer, escapedW, &lenW, dwFlags)) == E_POINTER) {
......
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