[PATCH v2 0/1] MR6070: mshtml: Zero output iface on failure in get_document_node().
The interface is later checked for NULL, this avoids crashes in case of failure here. -- v2: mshtml: Check get_document_node() result in get_node(). https://gitlab.winehq.org/wine/wine/-/merge_requests/6070
From: Paul Gofman <pgofman(a)codeweavers.com> Suggested by Gabriel Ivăncescu. --- dlls/mshtml/htmlnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index ceb50a17d02..36e89818bb3 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1410,7 +1410,7 @@ HRESULT get_node(nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret) hres = get_document_node(dom_document, &document); nsIDOMDocument_Release(dom_document); - if(!document) + if(FAILED(hres)) return E_FAIL; hres = create_node(document, nsnode, ret); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6070
This merge request was approved by Jacek Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6070
It seems that there is not a complete solution. Depending on the reason of the failure, it's either semi-expected (in which case we should downgrade ERR to WARN) or the root of the problem is somewhere else. Anyway, the change itself is fine. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6070#note_76246
participants (3)
-
Jacek Caban (@jacek) -
Paul Gofman -
Paul Gofman (@gofman)