wininet: Don't use INTERNET_MAX_HOST_NAME_LENGTH in InternetGetSecurityInfoByURLW,.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-04-27 19:19:47 +02:00 committed by Alexandre Julliard
parent 1a20354ca5
commit 72f5c3f2e7
1 changed files with 10 additions and 5 deletions

View File

@ -4499,23 +4499,28 @@ BOOL WINAPI InternetGetSecurityInfoByURLA(LPSTR lpszURL, PCCERT_CHAIN_CONTEXT *p
*/
BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT *ppCertChain, DWORD *pdwSecureFlags)
{
WCHAR hostname[INTERNET_MAX_HOST_NAME_LENGTH];
URL_COMPONENTSW url = {sizeof(url)};
server_t *server;
BOOL res = FALSE;
WCHAR *hostname;
BOOL res;
TRACE("(%s %p %p)\n", debugstr_w(lpszURL), ppCertChain, pdwSecureFlags);
url.lpszHostName = hostname;
url.dwHostNameLength = sizeof(hostname)/sizeof(WCHAR);
url.dwHostNameLength = 1;
res = InternetCrackUrlW(lpszURL, 0, 0, &url);
if(!res || url.nScheme != INTERNET_SCHEME_HTTPS) {
SetLastError(ERROR_INTERNET_ITEM_NOT_FOUND);
return FALSE;
}
hostname = heap_strndupW(url.lpszHostName, url.dwHostNameLength);
if(!hostname) {
SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
server = get_server(hostname, url.nPort, TRUE, FALSE);
heap_free(hostname);
if(!server) {
SetLastError(ERROR_INTERNET_ITEM_NOT_FOUND);
return FALSE;