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
1f7fb03e
Commit
1f7fb03e
authored
Aug 12, 2015
by
Daniel Lehman
Committed by
Alexandre Julliard
Aug 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix crash when merging Text nodes.
parent
27f7174d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
node.c
dlls/msxml3/node.c
+2
-2
domdoc.c
dlls/msxml3/tests/domdoc.c
+66
-0
No files found.
dlls/msxml3/node.c
View file @
1f7fb03e
...
...
@@ -496,7 +496,7 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
refcount
=
xmlnode_get_inst_cnt
(
node_obj
);
if
(
refcount
)
xmldoc_add_refs
(
before_node_obj
->
node
->
doc
,
refcount
);
xmlAddPrevSibling
(
before_node_obj
->
node
,
node_obj
->
node
);
node_obj
->
node
=
xmlAddPrevSibling
(
before_node_obj
->
node
,
node_obj
->
node
);
if
(
refcount
)
xmldoc_release_refs
(
doc
,
refcount
);
node_obj
->
parent
=
This
->
parent
;
}
...
...
@@ -508,7 +508,7 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
if
(
refcount
)
xmldoc_add_refs
(
This
->
node
->
doc
,
refcount
);
/* xmlAddChild doesn't unlink node from previous parent */
xmlUnlinkNode
(
node_obj
->
node
);
xmlAddChild
(
This
->
node
,
node_obj
->
node
);
node_obj
->
node
=
xmlAddChild
(
This
->
node
,
node_obj
->
node
);
if
(
refcount
)
xmldoc_release_refs
(
doc
,
refcount
);
node_obj
->
parent
=
This
->
iface
;
}
...
...
dlls/msxml3/tests/domdoc.c
View file @
1f7fb03e
...
...
@@ -11935,6 +11935,71 @@ static void test_url(void)
IXMLDOMDocument_Release
(
doc
);
}
static
void
test_merging_text
(
void
)
{
IXMLDOMText
*
nodetext
;
IXMLDOMText
*
newtext
;
IXMLDOMElement
*
root
;
IXMLDOMDocument
*
doc
;
IXMLDOMNode
*
first
;
HRESULT
hr
;
VARIANT
v
;
BSTR
str
;
int
i
;
doc
=
create_document
(
&
IID_IXMLDOMDocument
);
hr
=
IXMLDOMDocument_createElement
(
doc
,
_bstr_
(
"Testing"
),
&
root
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IXMLDOMDocument_appendChild
(
doc
,
(
IXMLDOMNode
*
)
root
,
NULL
);
EXPECT_HR
(
hr
,
S_OK
);
/* test xmlAddChild */
for
(
i
=
0
;
i
<
10
;
i
++
)
{
str
=
SysAllocString
(
szstr1
);
hr
=
IXMLDOMDocument_createTextNode
(
doc
,
str
,
&
nodetext
);
SysFreeString
(
str
);
EXPECT_HR
(
hr
,
S_OK
);
newtext
=
NULL
;
hr
=
IXMLDOMElement_appendChild
(
root
,
(
IXMLDOMNode
*
)
nodetext
,
(
IXMLDOMNode
**
)
&
newtext
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
nodetext
==
newtext
,
"expected %p, got %p
\n
"
,
nodetext
,
newtext
);
IXMLDOMText_Release
(
newtext
);
IXMLDOMText_Release
(
nodetext
);
}
/* test xmlAddPrevSibling */
hr
=
IXMLDOMElement_get_firstChild
(
root
,
&
first
);
EXPECT_HR
(
hr
,
S_OK
);
V_VT
(
&
v
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
v
)
=
(
IUnknown
*
)
first
;
for
(
i
=
0
;
i
<
10
;
i
++
)
{
str
=
SysAllocString
(
szstr2
);
hr
=
IXMLDOMDocument_createTextNode
(
doc
,
str
,
&
nodetext
);
SysFreeString
(
str
);
EXPECT_HR
(
hr
,
S_OK
);
newtext
=
NULL
;
hr
=
IXMLDOMElement_insertBefore
(
root
,
(
IXMLDOMNode
*
)
nodetext
,
v
,
(
IXMLDOMNode
**
)
&
newtext
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
nodetext
==
newtext
,
"expected %p, got %p
\n
"
,
nodetext
,
newtext
);
IXMLDOMText_Release
(
newtext
);
IXMLDOMText_Release
(
nodetext
);
}
IXMLDOMNode_Release
(
first
);
IXMLDOMElement_Release
(
root
);
IXMLDOMDocument_Release
(
doc
);
free_bstrs
();
}
START_TEST
(
domdoc
)
{
HRESULT
hr
;
...
...
@@ -12014,6 +12079,7 @@ START_TEST(domdoc)
test_namedmap_newenum
();
test_xmlns_attribute
();
test_url
();
test_merging_text
();
test_xsltemplate
();
test_xsltext
();
...
...
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