Commit b53b717d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Always set returned size in InternetGetCookieExA.

parent 8332d806
......@@ -808,7 +808,7 @@ BOOL WINAPI InternetGetCookieExA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
LPSTR lpCookieData, LPDWORD lpdwSize, DWORD flags, void *reserved)
{
WCHAR *url, *name;
DWORD len, size;
DWORD len, size = 0;
BOOL r;
TRACE("(%s %s %p %p(%u) %x %p)\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName),
......@@ -841,12 +841,12 @@ BOOL WINAPI InternetGetCookieExA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
r = FALSE;
}
}
*lpdwSize = size;
}
heap_free( szCookieData );
}
}
*lpdwSize = size;
heap_free( name );
heap_free( url );
return r;
......
......@@ -360,11 +360,13 @@ static void test_get_cookie(void)
DWORD len;
BOOL ret;
len = 1024;
SetLastError(0xdeadbeef);
ret = InternetGetCookieA("http://www.example.com", NULL, NULL, &len);
ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS,
"InternetGetCookie should have failed with %s and error %d\n",
ret ? "TRUE" : "FALSE", GetLastError());
ok(!len, "len = %u\n", len);
}
......
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