Commit 255eebe4 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

wininet: Handle NULL input for FindCloseUrlCache.

parent 382ed33b
......@@ -166,7 +166,18 @@ static void test_urlcacheA(void)
ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "local file should no longer exist\n");
}
static void test_FindCloseUrlCache(void)
{
BOOL r;
DWORD err;
r = FindCloseUrlCache(NULL);
err = GetLastError();
ok(0 == r, "expected 0, got %d\n", r);
ok(ERROR_INVALID_HANDLE == err, "expected %d, got %d\n", ERROR_INVALID_HANDLE, err);
}
START_TEST(urlcache)
{
test_urlcacheA();
test_FindCloseUrlCache();
}
......@@ -3127,7 +3127,7 @@ BOOL WINAPI FindCloseUrlCache(HANDLE hEnumHandle)
TRACE("(%p)\n", hEnumHandle);
if (pEntryHandle->dwMagic != URLCACHE_FIND_ENTRY_HANDLE_MAGIC)
if (!pEntryHandle || pEntryHandle->dwMagic != URLCACHE_FIND_ENTRY_HANDLE_MAGIC)
{
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
......
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