Module: wine Branch: master Commit: 35ae01023bbfe1963a099f6d717367ca6f156adf URL: https://source.winehq.org/git/wine.git/?a=commit;h=35ae01023bbfe1963a099f6d7...
Author: Daniel Lehman dlehman25@gmail.com Date: Fri Oct 22 16:41:28 2021 +0300
msxml3: Handle NULL XML declaration.
Signed-off-by: Daniel Lehman dlehman25@gmail.com Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 1d96c9391ee..4c5c6b12c68 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -754,6 +754,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 22fbe06abd7..70e2da89a2f 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);