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
b2fe6757
Commit
b2fe6757
authored
Oct 12, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Handle nil elements in the reader.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9599479e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
reader.c
dlls/webservices/reader.c
+20
-0
No files found.
dlls/webservices/reader.c
View file @
b2fe6757
...
...
@@ -4052,6 +4052,24 @@ static HRESULT read_type_struct( struct reader *reader, WS_TYPE_MAPPING mapping,
}
}
static
HRESULT
is_nil_element
(
const
WS_XML_ELEMENT_NODE
*
elem
)
{
static
const
WS_XML_STRING
localname
=
{
3
,
(
BYTE
*
)
"nil"
};
static
const
WS_XML_STRING
ns
=
{
41
,
(
BYTE
*
)
"http://www.w3.org/2001/XMLSchema-instance"
};
ULONG
i
;
for
(
i
=
0
;
i
<
elem
->
attributeCount
;
i
++
)
{
const
WS_XML_UTF8_TEXT
*
text
=
(
WS_XML_UTF8_TEXT
*
)
elem
->
attributes
[
i
]
->
value
;
if
(
elem
->
attributes
[
i
]
->
isXmlNs
)
continue
;
if
(
WsXmlStringEquals
(
elem
->
attributes
[
i
]
->
localName
,
&
localname
,
NULL
)
==
S_OK
&&
WsXmlStringEquals
(
elem
->
attributes
[
i
]
->
ns
,
&
ns
,
NULL
)
==
S_OK
&&
text
->
value
.
length
==
4
&&
!
memcmp
(
text
->
value
.
bytes
,
"true"
,
4
))
return
TRUE
;
}
return
FALSE
;
}
static
HRESULT
read_type
(
struct
reader
*
reader
,
WS_TYPE_MAPPING
mapping
,
WS_TYPE
type
,
const
WS_XML_STRING
*
localname
,
const
WS_XML_STRING
*
ns
,
const
void
*
desc
,
WS_READ_OPTION
option
,
WS_HEAP
*
heap
,
...
...
@@ -4064,6 +4082,8 @@ static HRESULT read_type( struct reader *reader, WS_TYPE_MAPPING mapping, WS_TYP
case
WS_ELEMENT_TYPE_MAPPING
:
case
WS_ELEMENT_CONTENT_TYPE_MAPPING
:
if
((
hr
=
read_type_next_element_node
(
reader
,
localname
,
ns
))
!=
S_OK
)
return
hr
;
if
((
option
==
WS_READ_NILLABLE_POINTER
||
option
==
WS_READ_NILLABLE_VALUE
)
&&
is_nil_element
(
&
reader
->
current
->
hdr
))
return
read_type_next_node
(
reader
);
break
;
case
WS_ANY_ELEMENT_TYPE_MAPPING
:
...
...
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