From: Gabriel Ivăncescu gabrielopcode@gmail.com
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlwindow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 6c550172d68..e05dc143c08 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3219,8 +3219,10 @@ static HRESULT check_target_origin(HTMLInnerWindow *window, const WCHAR *target_ goto done;
hres = IUri_GetPort(uri, &port); - if(hres != S_OK) + if(hres != S_OK) { + hres = FAILED(hres) ? hres : S_OK; /* some protocols don't have ports (e.g. res) */ goto done; + } hres = IUri_GetPort(target, &port2); if(hres == S_OK && port != port2) hres = S_FALSE;
Jacek Caban (@jacek) commented about dlls/mshtml/htmlwindow.c:
goto done; hres = IUri_GetPort(uri, &port);
- if(hres != S_OK)
- if(hres != S_OK) {
hres = FAILED(hres) ? hres : S_OK; /* some protocols don't have ports (e.g. res) */
Should we make sure that target URI also doesn't have a port?
On Tue May 30 11:30:40 2023 +0000, Jacek Caban wrote:
Should we make sure that target URI also doesn't have a port?
I think that's unnecessary since we already tested if the protocols match earlier, right? Unless I'm missing something.
On Tue May 30 13:55:29 2023 +0000, Gabriel Ivăncescu wrote:
I think that's unnecessary since we already tested if the protocols match earlier, right? Unless I'm missing something.
Port may be optional. In case of builtin protocols, urlmon is smart about it (see default_ports array), but that does not scale to arbitrary protocols.