[PATCH 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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6070
From: Paul Gofman <pgofman(a)codeweavers.com> Suggested by Gabriel Ivăncescu. --- dlls/mshtml/htmldoc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 0ed6b1d6710..32c7f411e27 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5841,6 +5841,7 @@ HRESULT get_document_node(nsIDOMDocument *dom_document, HTMLDocumentNode **ret) if(!node) { ERR("document not initialized\n"); + *ret = NULL; return E_FAIL; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6070
I think it's better to just check the hres (return value) on the caller and return it on failure. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6070#note_76085
participants (3)
-
Gabriel Ivăncescu -
Paul Gofman -
Paul Gofman (@gofman)