shlwapi: Check an argument to UrlEscapeA.

oldstable
Lei Zhang 2008-01-09 13:50:14 -08:00 committed by Alexandre Julliard
parent 0da7c8f444
commit 32fda2113d
2 changed files with 8 additions and 0 deletions

View File

@ -479,6 +479,11 @@ static void test_UrlEscape(void)
ok(size == 1, "got %d, expected %d\n", size, 1);
}
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 {

View File

@ -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) {