[PATCH 4/5] msxml3: Handle NULL XML declaration.

Daniel Lehman dlehman25 at gmail.com
Wed Sep 29 00:16:48 CDT 2021


Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
 dlls/msxml3/pi.c           | 3 +++
 dlls/msxml3/tests/domdoc.c | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c
index 95e6cf34e1c..f597cb7176a 100644
--- a/dlls/msxml3/pi.c
+++ b/dlls/msxml3/pi.c
@@ -760,6 +760,9 @@ HRESULT dom_pi_put_xml_decl(IXMLDOMNode *node, BSTR data)
     HRESULT hr;
     BSTR name;
 
+    if (!data)
+        return XML_E_XMLDECLSYNTAX;
+
     node_obj = get_node_obj(node);
     hr = node_set_content(node_obj, data);
     if (FAILED(hr))
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index e1f71bf5445..dbd56e11f68 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -8596,7 +8596,6 @@ static void test_createProcessingInstruction(void)
     hr = IXMLDOMDocument_createProcessingInstruction(doc, NULL, _bstr_("version=\"1.0\" encoding=\"UTF-8\""), &pi);
     ok(hr == E_FAIL, "got 0x%08x\n", hr);
     hr = IXMLDOMDocument_createProcessingInstruction(doc, _bstr_("xml"), NULL, &pi);
-todo_wine
     ok(hr == XML_E_XMLDECLSYNTAX, "got 0x%08x\n", hr);
     hr = IXMLDOMDocument_createProcessingInstruction(doc, _bstr_("xml"), _bstr_("version=\"1.0\" encoding=UTF-8"), &pi);
     ok(hr == XML_E_MISSINGQUOTE, "got 0x%08x\n", hr);
-- 
2.25.1




More information about the wine-devel mailing list