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
3d69d71e
Commit
3d69d71e
authored
Feb 11, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix CryptBinaryToStringW() to return required length properly.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eb00dbd9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
base64.c
dlls/crypt32/base64.c
+7
-4
base64.c
dlls/crypt32/tests/base64.c
+1
-4
No files found.
dlls/crypt32/base64.c
View file @
3d69d71e
...
...
@@ -490,16 +490,19 @@ static BOOL BinaryToHexW(const BYTE *bin, DWORD nbin, DWORD flags, LPWSTR str, D
needed
=
2
;
needed
+=
nbin
*
2
+
1
;
if
(
!
str
)
{
*
nstr
=
needed
;
return
TRUE
;
}
if
(
needed
>
*
nstr
)
{
SetLastError
(
ERROR_MORE_DATA
);
return
FALSE
;
}
*
nstr
=
needed
;
if
(
!
str
)
return
TRUE
;
while
(
nbin
--
)
{
*
str
++
=
hex
[(
*
bin
>>
4
)
&
0xf
];
...
...
dlls/crypt32/tests/base64.c
View file @
3d69d71e
...
...
@@ -366,10 +366,8 @@ static void test_CryptBinaryToString(void)
/* Systems that don't support HEXRAW format convert to BASE64 instead - 3 bytes in -> 4 chars + crlf + 1 null out. */
strLen
=
0
;
ret
=
CryptBinaryToStringW
(
input
,
3
,
CRYPT_STRING_HEXRAW
,
NULL
,
&
strLen
);
todo_wine
{
ok
(
ret
,
"Failed to get string length.
\n
"
);
ok
(
strLen
==
9
||
broken
(
strLen
==
7
),
"Unexpected string length %d.
\n
"
,
strLen
);
}
if
(
strLen
==
7
)
{
win_skip
(
"CryptBinaryToString(HEXRAW) not supported
\n
"
);
...
...
@@ -383,10 +381,9 @@ todo_wine {
{
strLen
=
0
;
ret
=
CryptBinaryToStringW
(
input
,
sizeof
(
input
),
CRYPT_STRING_HEXRAW
|
flags
[
i
],
NULL
,
&
strLen
);
todo_wine
{
ok
(
ret
,
"CryptBinaryToStringW failed: %d
\n
"
,
GetLastError
());
ok
(
strLen
>
0
,
"Unexpected string length.
\n
"
);
}
strLen
=
~
0
;
ret
=
CryptBinaryToStringW
(
input
,
sizeof
(
input
),
CRYPT_STRING_HEXRAW
|
flags
[
i
],
NULL
,
&
strLen
);
...
...
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