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
43e213e2
Commit
43e213e2
authored
Nov 17, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Fix calculation of the end of a UTF-8 sequence.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
28f66b2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
reader.c
dlls/webservices/reader.c
+1
-1
reader.c
dlls/webservices/tests/reader.c
+10
-0
No files found.
dlls/webservices/reader.c
View file @
43e213e2
...
...
@@ -1035,7 +1035,7 @@ static inline unsigned int read_utf8_char( struct reader *reader, unsigned int *
}
len
=
utf8_length
[
ch
-
0x80
];
if
(
reader
->
read_pos
+
len
>=
reader
->
read_size
)
return
0
;
end
=
reader
->
read_bufptr
+
reader
->
read_pos
+
len
;
end
=
reader
->
read_bufptr
+
reader
->
read_pos
+
len
+
1
;
res
=
ch
&
utf8_mask
[
len
];
switch
(
len
)
...
...
dlls/webservices/tests/reader.c
View file @
43e213e2
...
...
@@ -1325,6 +1325,8 @@ static void test_WsReadType(void)
static
const
WCHAR
testW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
0
};
static
const
GUID
guid1
=
{
0
,
0
,
0
,{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}};
static
const
GUID
guid2
=
{
0
,
0
,
0
,{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0xa1
}};
static
const
char
utf8
[]
=
{
'<'
,
't'
,
'>'
,
0xe2
,
0x80
,
0x99
,
'<'
,
'/'
,
't'
,
'>'
};
static
const
WCHAR
utf8W
[]
=
{
0x2019
,
0
};
HRESULT
hr
;
WS_XML_READER
*
reader
;
WS_HEAP
*
heap
;
...
...
@@ -1636,6 +1638,14 @@ static void test_WsReadType(void)
WS_READ_REQUIRED_VALUE
,
heap
,
&
val_bytes
,
sizeof
(
val_bytes
),
NULL
);
ok
(
hr
==
WS_E_INVALID_FORMAT
,
"got %08x
\n
"
,
hr
);
val_str
=
NULL
;
prepare_type_test
(
reader
,
utf8
,
sizeof
(
utf8
)
);
hr
=
WsReadType
(
reader
,
WS_ELEMENT_CONTENT_TYPE_MAPPING
,
WS_WSZ_TYPE
,
NULL
,
WS_READ_REQUIRED_POINTER
,
heap
,
&
val_str
,
sizeof
(
val_str
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
val_str
!=
NULL
,
"pointer not set
\n
"
);
if
(
val_str
)
ok
(
!
lstrcmpW
(
val_str
,
utf8W
),
"wrong data %s
\n
"
,
wine_dbgstr_w
(
val_str
)
);
WsFreeReader
(
reader
);
WsFreeHeap
(
heap
);
}
...
...
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