Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
28debe67
Commit
28debe67
authored
Mar 01, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Fixed length calculation in conversion to DBTYPE_STR.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1727dd41
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
convert.c
dlls/oledb32/convert.c
+9
-8
No files found.
dlls/oledb32/convert.c
View file @
28debe67
...
...
@@ -813,26 +813,27 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
SysFreeString
(
b
);
return
hr
;
}
case
DBTYPE_STR
:
{
BSTR
b
;
DBLENGTH
bstr_len
;
DBLENGTH
length
;
INT
bytes_to_copy
;
hr
=
IDataConvert_DataConvert
(
iface
,
src_type
,
DBTYPE_BSTR
,
src_len
,
&
bstr_len
,
hr
=
IDataConvert_DataConvert
(
iface
,
src_type
,
DBTYPE_BSTR
,
src_len
,
&
length
,
src
,
&
b
,
sizeof
(
BSTR
),
src_status
,
dst_status
,
precision
,
scale
,
flags
);
if
(
hr
!=
S_OK
)
return
hr
;
bstr_len
=
SysStringLen
(
b
);
*
dst_len
=
bstr_len
*
sizeof
(
char
)
;
/* Doesn't include size for '\0' */
length
=
WideCharToMultiByte
(
CP_ACP
,
0
,
b
,
SysStringLen
(
b
),
NULL
,
0
,
NULL
,
NULL
);
*
dst_len
=
length
;
/* Doesn't include size for '\0' */
*
dst_status
=
DBSTATUS_S_OK
;
bytes_to_copy
=
min
(
*
dst_len
+
sizeof
(
char
)
,
dst_max_len
);
bytes_to_copy
=
min
(
length
+
1
,
dst_max_len
);
if
(
dst
)
{
if
(
bytes_to_copy
>=
sizeof
(
char
))
{
WideCharToMultiByte
(
CP_ACP
,
0
,
b
,
bytes_to_copy
-
sizeof
(
char
),
dst
,
dst_max_len
,
NULL
,
NULL
);
*
((
char
*
)
dst
+
bytes_to_copy
/
sizeof
(
char
)
-
1
)
=
0
;
if
(
bytes_to_copy
<
*
dst_len
+
sizeof
(
char
)
)
WideCharToMultiByte
(
CP_ACP
,
0
,
b
,
SysStringLen
(
b
),
dst
,
bytes_to_copy
-
1
,
NULL
,
NULL
);
*
((
char
*
)
dst
+
bytes_to_copy
-
1
)
=
0
;
if
(
bytes_to_copy
<
length
+
1
)
*
dst_status
=
DBSTATUS_S_TRUNCATED
;
}
else
...
...
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