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
bec279d8
Commit
bec279d8
authored
Oct 29, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version: Use the string value length when converting strings.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
efe0a09f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
version.c
dlls/version/version.c
+4
-3
No files found.
dlls/version/version.c
View file @
bec279d8
...
...
@@ -1010,6 +1010,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
BOOL
ret
,
isText
;
INT
len
;
LPWSTR
lpSubBlockW
;
UINT
value_len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSubBlock
,
-
1
,
NULL
,
0
);
lpSubBlockW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
...
...
@@ -1019,7 +1020,8 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSubBlock
,
-
1
,
lpSubBlockW
,
len
);
ret
=
VersionInfo32_QueryValue
(
pBlock
,
lpSubBlockW
,
lplpBuffer
,
puLen
,
&
isText
);
ret
=
VersionInfo32_QueryValue
(
pBlock
,
lpSubBlockW
,
lplpBuffer
,
&
value_len
,
&
isText
);
if
(
puLen
)
*
puLen
=
value_len
;
HeapFree
(
GetProcessHeap
(),
0
,
lpSubBlockW
);
...
...
@@ -1030,8 +1032,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
*/
LPSTR
lpBufferA
=
(
LPSTR
)
pBlock
+
info
->
wLength
+
4
;
DWORD
pos
=
(
LPCSTR
)
*
lplpBuffer
-
(
LPCSTR
)
pBlock
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
*
lplpBuffer
,
-
1
,
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
*
lplpBuffer
,
value_len
,
lpBufferA
+
pos
,
info
->
wLength
-
pos
,
NULL
,
NULL
);
*
lplpBuffer
=
lpBufferA
+
pos
;
if
(
puLen
)
*
puLen
=
len
;
...
...
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