wininet: Check return value of InternetCrackUrl when checking referrer host.
This commit is contained in:
parent
a39ac0a701
commit
fe475d9e88
@ -1441,13 +1441,14 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
|
|||||||
WCHAR buf[MAXHOSTNAME];
|
WCHAR buf[MAXHOSTNAME];
|
||||||
URL_COMPONENTSW UrlComponents;
|
URL_COMPONENTSW UrlComponents;
|
||||||
|
|
||||||
|
buf[0] = '\0';
|
||||||
memset( &UrlComponents, 0, sizeof UrlComponents );
|
memset( &UrlComponents, 0, sizeof UrlComponents );
|
||||||
UrlComponents.dwStructSize = sizeof UrlComponents;
|
UrlComponents.dwStructSize = sizeof UrlComponents;
|
||||||
UrlComponents.lpszHostName = buf;
|
UrlComponents.lpszHostName = buf;
|
||||||
UrlComponents.dwHostNameLength = MAXHOSTNAME;
|
UrlComponents.dwHostNameLength = MAXHOSTNAME;
|
||||||
|
|
||||||
InternetCrackUrlW(lpszReferrer, 0, 0, &UrlComponents);
|
if (InternetCrackUrlW(lpszReferrer, 0, 0, &UrlComponents) &&
|
||||||
if (strlenW(UrlComponents.lpszHostName))
|
strlenW(UrlComponents.lpszHostName))
|
||||||
HTTP_ProcessHeader(lpwhr, szHost, UrlComponents.lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ);
|
HTTP_ProcessHeader(lpwhr, szHost, UrlComponents.lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user