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
f66c8972
Commit
f66c8972
authored
Jul 19, 2023
by
Yuxuan Shui
Committed by
Alexandre Julliard
Jul 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix out-of-bound access in create_locinfo.
Fixes regression introduced by
24a2b625
. Signed-off-by:
Yuxuan Shui
<
yshui@codeweavers.com
>
parent
36ef8327
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
locale.c
dlls/msvcrt/locale.c
+6
-6
No files found.
dlls/msvcrt/locale.c
View file @
f66c8972
...
...
@@ -1226,7 +1226,7 @@ static __lc_time_data* create_time_data(WCHAR *sname)
int
i
,
ret
,
size
;
LCID
lcid
=
LocaleNameToLCID
(
sname
,
LCID_CONVERSION_FLAGS
);
size
=
sizeof
(
__lc_time_data
)
;
size
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
time_data
);
i
++
)
{
ret
=
GetLocaleInfoA
(
lcid
,
time_data
[
i
],
NULL
,
0
);
if
(
!
ret
)
...
...
@@ -1241,10 +1241,10 @@ static __lc_time_data* create_time_data(WCHAR *sname)
#endif
}
#if _MSVCR_VER >= 110
size
+=
wcslen
(
sname
)
*
sizeof
(
wchar_t
);
size
+=
(
wcslen
(
sname
)
+
1
)
*
sizeof
(
wchar_t
);
#endif
cur
=
malloc
(
size
);
cur
=
malloc
(
FIELD_OFFSET
(
__lc_time_data
,
data
[
size
])
);
if
(
!
cur
)
return
NULL
;
...
...
@@ -1256,13 +1256,13 @@ static __lc_time_data* create_time_data(WCHAR *sname)
#if _MSVCR_VER == 0 || _MSVCR_VER >= 100
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
time_data
);
i
++
)
{
cur
->
wstr
.
wstr
[
i
]
=
(
wchar_t
*
)
&
cur
->
data
[
ret
];
ret
+=
GetLocaleInfoEx
(
sname
,
time_data
[
i
],
(
wchar_t
*
)
&
cur
->
data
[
ret
],
size
-
ret
)
*
sizeof
(
wchar_t
);
ret
+=
GetLocaleInfoEx
(
sname
,
time_data
[
i
],
(
wchar_t
*
)
&
cur
->
data
[
ret
],
(
size
-
ret
)
/
sizeof
(
wchar_t
))
*
sizeof
(
wchar_t
);
}
#endif
#if _MSVCR_VER >= 110
cur
->
locname
=
(
wchar_t
*
)
&
cur
->
data
[
ret
];
wcs
ncpy
((
wchar_t
*
)
&
cur
->
data
[
ret
],
sname
,
size
-
ret
);
wcs
cpy
((
wchar_t
*
)
&
cur
->
data
[
ret
],
sname
);
#else
cur
->
lcid
=
lcid
;
#endif
...
...
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