Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
59c2b325
Commit
59c2b325
authored
Aug 09, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Aug 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Handle NULL parameter in IXMLDOMElement::get_ownerDocument().
parent
f34efaab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
node.c
dlls/msxml3/node.c
+2
-0
domdoc.c
dlls/msxml3/tests/domdoc.c
+54
-0
No files found.
dlls/msxml3/node.c
View file @
59c2b325
...
...
@@ -654,6 +654,8 @@ HRESULT node_has_childnodes(const xmlnode *This, VARIANT_BOOL *ret)
HRESULT
node_get_owner_doc
(
const
xmlnode
*
This
,
IXMLDOMDocument
**
doc
)
{
if
(
!
doc
)
return
E_INVALIDARG
;
return
get_domdoc_from_xmldoc
(
This
->
node
->
doc
,
(
IXMLDOMDocument3
**
)
doc
);
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
59c2b325
...
...
@@ -7467,6 +7467,19 @@ static void test_get_ownerDocument(void)
IXMLDOMSchemaCollection
*
cache
;
VARIANT_BOOL
b
;
VARIANT
var
;
IXMLDOMElement
*
element
;
IXMLDOMNodeList
*
node_list
;
IXMLDOMAttribute
*
attr
;
LONG
i
,
len
;
HRESULT
hr
;
const
CHAR
nodeXML
[]
=
"<root id='0'>"
" <!-- comment node 0 -->"
" text node 0"
" <x attr='val'></x>"
" <?foo value='PI for x'?>"
" <![CDATA[ cdata ]]>"
"</root>"
;
if
(
!
is_clsid_supported
(
&
CLSID_DOMDocument2
,
&
IID_IXMLDOMDocument2
))
return
;
if
(
!
is_clsid_supported
(
&
CLSID_XMLSchemaCache
,
&
IID_IXMLDOMSchemaCollection
))
return
;
...
...
@@ -7519,6 +7532,47 @@ static void test_get_ownerDocument(void)
check_default_props
(
doc_owner
);
check_default_props
(
doc
);
/* NULL check */
hr
=
IXMLDOMDocument_loadXML
(
doc1
,
_bstr_
(
nodeXML
),
&
b
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
hr
=
IXMLDOMDocument_get_documentElement
(
doc1
,
&
element
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMElement_get_childNodes
(
element
,
&
node_list
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMNodeList_get_length
(
node_list
,
&
len
);
EXPECT_HR
(
hr
,
S_OK
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
hr
=
IXMLDOMNodeList_get_item
(
node_list
,
i
,
&
node
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMNode_get_ownerDocument
(
node
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
IXMLDOMNode_Release
(
node
);
}
IXMLDOMElement_Release
(
element
);
/* Test Attribute Node */
hr
=
IXMLDOMNodeList_get_item
(
node_list
,
2
,
&
node
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMNode_QueryInterface
(
node
,
&
IID_IXMLDOMElement
,
(
void
**
)
&
element
);
EXPECT_HR
(
hr
,
S_OK
);
IXMLDOMNode_Release
(
node
);
hr
=
IXMLDOMElement_getAttributeNode
(
element
,
_bstr_
(
"attr"
),
&
attr
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
attr
!=
NULL
,
"attr == NULL
\n
"
);
IXMLDOMElement_Release
(
element
);
hr
=
IXMLDOMAttribute_get_ownerDocument
(
attr
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
IXMLDOMAttribute_Release
(
attr
);
IXMLDOMNodeList_Release
(
node_list
);
IXMLDOMSchemaCollection_Release
(
cache
);
IXMLDOMDocument_Release
(
doc1
);
IXMLDOMDocument_Release
(
doc2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment