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
d641bc08
Commit
d641bc08
authored
Jan 20, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Parse element names.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
477b7649
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
reader.c
dlls/webservices/reader.c
+21
-9
No files found.
dlls/webservices/reader.c
View file @
d641bc08
...
@@ -944,10 +944,9 @@ static HRESULT read_element( struct reader *reader )
...
@@ -944,10 +944,9 @@ static HRESULT read_element( struct reader *reader )
}
}
if
(
!
len
)
goto
error
;
if
(
!
len
)
goto
error
;
if
((
hr
=
parse_name
(
start
,
len
,
&
elem
->
prefix
,
&
elem
->
localName
))
!=
S_OK
)
goto
error
;
if
(
!
elem
->
prefix
->
length
)
elem
->
prefix
->
bytes
=
NULL
;
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
if
(
!
(
elem
->
localName
=
alloc_xml_string
(
start
,
len
)))
goto
error
;
if
(
!
(
elem
->
prefix
=
alloc_xml_string
(
NULL
,
0
)))
goto
error
;
elem
->
prefix
->
bytes
=
NULL
;
if
(
!
(
elem
->
ns
=
alloc_xml_string
(
NULL
,
0
)))
goto
error
;
if
(
!
(
elem
->
ns
=
alloc_xml_string
(
NULL
,
0
)))
goto
error
;
for
(;;)
for
(;;)
...
@@ -1064,16 +1063,23 @@ static BOOL cmp_localname( const unsigned char *name1, ULONG len1, const unsigne
...
@@ -1064,16 +1063,23 @@ static BOOL cmp_localname( const unsigned char *name1, ULONG len1, const unsigne
return
TRUE
;
return
TRUE
;
}
}
static
struct
node
*
find_parent_element
(
struct
node
*
node
,
const
unsigned
char
*
localname
,
ULONG
len
)
static
struct
node
*
find_parent_element
(
struct
node
*
node
,
const
WS_XML_STRING
*
prefix
,
const
WS_XML_STRING
*
localname
)
{
{
struct
node
*
parent
;
struct
node
*
parent
;
WS_XML_STRING
*
name
;
const
WS_XML_STRING
*
str
;
for
(
parent
=
node
;
parent
;
parent
=
parent
->
parent
)
for
(
parent
=
node
;
parent
;
parent
=
parent
->
parent
)
{
{
if
(
parent
->
hdr
.
node
.
nodeType
!=
WS_XML_NODE_TYPE_ELEMENT
)
continue
;
if
(
parent
->
hdr
.
node
.
nodeType
!=
WS_XML_NODE_TYPE_ELEMENT
)
continue
;
name
=
((
WS_XML_ELEMENT_NODE
*
)
parent
)
->
localName
;
if
(
!
localname
)
return
parent
;
if
(
!
cmp_localname
(
name
->
bytes
,
name
->
length
,
localname
,
len
))
continue
;
str
=
parent
->
hdr
.
prefix
;
if
(
!
cmp_localname
(
str
->
bytes
,
str
->
length
,
prefix
->
bytes
,
prefix
->
length
))
continue
;
str
=
parent
->
hdr
.
localName
;
if
(
!
cmp_localname
(
str
->
bytes
,
str
->
length
,
localname
->
bytes
,
localname
->
length
))
continue
;
return
parent
;
return
parent
;
}
}
return
NULL
;
return
NULL
;
...
@@ -1084,6 +1090,8 @@ static HRESULT read_endelement( struct reader *reader )
...
@@ -1084,6 +1090,8 @@ static HRESULT read_endelement( struct reader *reader )
struct
node
*
node
,
*
parent
;
struct
node
*
node
,
*
parent
;
unsigned
int
len
=
0
,
ch
,
skip
;
unsigned
int
len
=
0
,
ch
,
skip
;
const
unsigned
char
*
start
;
const
unsigned
char
*
start
;
WS_XML_STRING
*
prefix
,
*
localname
;
HRESULT
hr
;
switch
(
reader
->
state
)
switch
(
reader
->
state
)
{
{
...
@@ -1111,8 +1119,12 @@ static HRESULT read_endelement( struct reader *reader )
...
@@ -1111,8 +1119,12 @@ static HRESULT read_endelement( struct reader *reader )
read_skip
(
reader
,
skip
);
read_skip
(
reader
,
skip
);
len
+=
skip
;
len
+=
skip
;
}
}
if
(
!
(
parent
=
find_parent_element
(
reader
->
current
,
start
,
len
)))
return
WS_E_INVALID_FORMAT
;
if
((
hr
=
parse_name
(
start
,
len
,
&
prefix
,
&
localname
))
!=
S_OK
)
return
hr
;
parent
=
find_parent_element
(
reader
->
current
,
prefix
,
localname
);
heap_free
(
prefix
);
heap_free
(
localname
);
if
(
!
parent
)
return
WS_E_INVALID_FORMAT
;
if
(
!
(
node
=
alloc_node
(
WS_XML_NODE_TYPE_END_ELEMENT
)))
return
E_OUTOFMEMORY
;
if
(
!
(
node
=
alloc_node
(
WS_XML_NODE_TYPE_END_ELEMENT
)))
return
E_OUTOFMEMORY
;
read_insert_node
(
reader
,
parent
,
node
);
read_insert_node
(
reader
,
parent
,
node
);
...
...
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