Commit e783c358 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Handle S_FALSE from IUri methods when checking targetOrigin.

parent 196f13c1
......@@ -3181,24 +3181,32 @@ static HRESULT check_target_origin(HTMLInnerWindow *window, const WCHAR *target_
goto done;
}
bstr = NULL;
hres = IUri_GetSchemeName(uri, &bstr);
if(FAILED(hres))
if(hres != S_OK) {
SysFreeString(bstr);
goto done;
}
hres = IUri_GetSchemeName(target, &bstr2);
if(SUCCEEDED(hres)) {
hres = !wcsicmp(bstr, bstr2) ? S_OK : S_FALSE;
if(hres == S_OK && wcsicmp(bstr, bstr2))
hres = S_FALSE;
SysFreeString(bstr2);
}
SysFreeString(bstr);
if(hres != S_OK)
goto done;
bstr = NULL;
hres = IUri_GetHost(uri, &bstr);
if(FAILED(hres))
if(hres != S_OK) {
SysFreeString(bstr);
goto done;
}
hres = IUri_GetHost(target, &bstr2);
if(SUCCEEDED(hres)) {
hres = !wcsicmp(bstr, bstr2) ? S_OK : S_FALSE;
if(hres == S_OK && wcsicmp(bstr, bstr2))
hres = S_FALSE;
SysFreeString(bstr2);
}
SysFreeString(bstr);
......@@ -3210,11 +3218,11 @@ static HRESULT check_target_origin(HTMLInnerWindow *window, const WCHAR *target_
goto done;
hres = IUri_GetPort(uri, &port);
if(FAILED(hres))
if(hres != S_OK)
goto done;
hres = IUri_GetPort(target, &port2);
if(SUCCEEDED(hres))
hres = (port == port2) ? S_OK : S_FALSE;
if(hres == S_OK && port != port2)
hres = S_FALSE;
done:
IUri_Release(target);
......
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