shlwapi: Check for NULL string in UrlIs.

This commit is contained in:
Andrew Eikum 2010-04-09 18:08:16 -05:00 committed by Alexandre Julliard
parent 5f6d99f513
commit 4811167410
2 changed files with 23 additions and 0 deletions

View File

@ -1048,6 +1048,15 @@ static void test_UrlCreateFromPath(void)
/* ########################### */
static void test_UrlIs_null(DWORD flag)
{
BOOL ret;
ret = pUrlIsA(NULL, flag);
ok(ret == FALSE, "pUrlIsA(NULL, %d) failed\n", flag);
ret = pUrlIsW(NULL, flag);
ok(ret == FALSE, "pUrlIsW(NULL, %d) failed\n", flag);
}
static void test_UrlIs(void)
{
BOOL ret;
@ -1059,6 +1068,14 @@ static void test_UrlIs(void)
return;
}
test_UrlIs_null(URLIS_APPLIABLE);
test_UrlIs_null(URLIS_DIRECTORY);
test_UrlIs_null(URLIS_FILEURL);
test_UrlIs_null(URLIS_HASQUERY);
test_UrlIs_null(URLIS_NOHISTORY);
test_UrlIs_null(URLIS_OPAQUE);
test_UrlIs_null(URLIS_URL);
for(i = 0; i < sizeof(TEST_PATH_IS_URL) / sizeof(TEST_PATH_IS_URL[0]); i++) {
MultiByteToWideChar(CP_ACP, 0, TEST_PATH_IS_URL[i].path, -1, wurl, 80);

View File

@ -1719,6 +1719,9 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis)
TRACE("(%s %d)\n", debugstr_a(pszUrl), Urlis);
if(!pszUrl)
return FALSE;
switch (Urlis) {
case URLIS_OPAQUE:
@ -1769,6 +1772,9 @@ BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis)
TRACE("(%s %d)\n", debugstr_w(pszUrl), Urlis);
if(!pszUrl)
return FALSE;
switch (Urlis) {
case URLIS_OPAQUE: