[PATCH 0/1] MR2915: mshtml: Allow protocols with no ports when checking target origin.
From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)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; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2915
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? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2915#note_34129
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.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2915#note_34133
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.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2915#note_34137
participants (2)
-
Gabriel Ivăncescu -
Jacek Caban (@jacek)