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
a8c6fda5
Commit
a8c6fda5
authored
Jul 28, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix uninitialized memory access in wcsrtombs_l implementation (valgrind).
parent
d61e1ffa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
wcs.c
dlls/msvcrt/wcs.c
+8
-5
No files found.
dlls/msvcrt/wcs.c
View file @
a8c6fda5
...
...
@@ -313,7 +313,6 @@ static MSVCRT_size_t CDECL MSVCRT_wcsrtombs_l(char *mbstr, const MSVCRT_wchar_t
MSVCRT_size_t
count
,
MSVCRT__locale_t
locale
)
{
MSVCRT_pthreadlocinfo
locinfo
;
char
default_char
=
'\0'
;
MSVCRT_size_t
tmp
=
0
;
BOOL
used_default
;
...
...
@@ -322,16 +321,20 @@ static MSVCRT_size_t CDECL MSVCRT_wcsrtombs_l(char *mbstr, const MSVCRT_wchar_t
else
locinfo
=
locale
->
locinfo
;
if
(
!
mbstr
)
return
WideCharToMultiByte
(
locinfo
->
lc_codepage
,
WC_NO_BEST_FIT_CHARS
,
*
wcstr
,
-
1
,
NULL
,
0
,
&
default_char
,
&
used_default
)
-
1
;
if
(
!
mbstr
)
{
tmp
=
WideCharToMultiByte
(
locinfo
->
lc_codepage
,
WC_NO_BEST_FIT_CHARS
,
*
wcstr
,
-
1
,
NULL
,
0
,
NULL
,
&
used_default
)
-
1
;
if
(
used_default
)
return
-
1
;
return
tmp
;
}
while
(
**
wcstr
)
{
char
buf
[
3
];
MSVCRT_size_t
i
,
size
;
size
=
WideCharToMultiByte
(
locinfo
->
lc_codepage
,
WC_NO_BEST_FIT_CHARS
,
*
wcstr
,
1
,
buf
,
3
,
&
default_char
,
&
used_default
);
*
wcstr
,
1
,
buf
,
3
,
NULL
,
&
used_default
);
if
(
used_default
)
return
-
1
;
if
(
tmp
+
size
>
count
)
...
...
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