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
e9cb2e6d
Commit
e9cb2e6d
authored
Dec 20, 2004
by
Michael Jung
Committed by
Alexandre Julliard
Dec 20, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ixed calculation of buffer size in CRYPT_ANSIToUnicode and
CRYPT_UnicodeToANSI.
parent
191a91d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
crypt.c
dlls/advapi32/crypt.c
+4
-2
No files found.
dlls/advapi32/crypt.c
View file @
e9cb2e6d
...
...
@@ -98,9 +98,10 @@ static inline BOOL CRYPT_UnicodeToANSI(LPCWSTR wstr, LPSTR* str, int strsize)
return
TRUE
;
}
count
=
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
count
=
count
<
strsize
?
count
:
strsize
;
if
(
strsize
==
-
1
)
*
str
=
CRYPT_Alloc
(
count
*
sizeof
(
CHAR
));
else
count
=
min
(
count
,
strsize
);
if
(
*
str
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
*
str
,
count
,
NULL
,
NULL
);
...
...
@@ -125,9 +126,10 @@ static inline BOOL CRYPT_ANSIToUnicode(LPCSTR str, LPWSTR* wstr, int wstrsize)
return
TRUE
;
}
wcount
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
wcount
=
wcount
<
wstrsize
/
sizeof
(
WCHAR
)
?
wcount
:
wstrsize
/
sizeof
(
WCHAR
);
if
(
wstrsize
==
-
1
)
*
wstr
=
CRYPT_Alloc
(
wcount
*
sizeof
(
WCHAR
));
else
wcount
=
min
(
wcount
,
wstrsize
/
sizeof
(
WCHAR
)
);
if
(
*
wstr
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
*
wstr
,
wcount
);
...
...
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