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
aaed0e81
Commit
aaed0e81
authored
Jun 11, 2013
by
Tatyana Fokina
Committed by
Alexandre Julliard
Jun 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Check the size of the string in CompareStringA.
parent
28951a09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
locale.c
dlls/kernel32/locale.c
+3
-3
locale.c
dlls/kernel32/tests/locale.c
+0
-1
No files found.
dlls/kernel32/locale.c
View file @
aaed0e81
...
...
@@ -2979,7 +2979,7 @@ INT WINAPI CompareStringA(LCID lcid, DWORD flags,
WCHAR
*
buf1W
=
NtCurrentTeb
()
->
StaticUnicodeBuffer
;
WCHAR
*
buf2W
=
buf1W
+
130
;
LPWSTR
str1W
,
str2W
;
INT
len1W
,
len2W
,
ret
;
INT
len1W
=
0
,
len2W
=
0
,
ret
;
UINT
locale_cp
=
CP_ACP
;
if
(
!
str1
||
!
str2
)
...
...
@@ -2994,7 +2994,7 @@ INT WINAPI CompareStringA(LCID lcid, DWORD flags,
if
(
len1
)
{
len1W
=
MultiByteToWideChar
(
locale_cp
,
0
,
str1
,
len1
,
buf1W
,
130
);
if
(
len1
<=
130
)
len1W
=
MultiByteToWideChar
(
locale_cp
,
0
,
str1
,
len1
,
buf1W
,
130
);
if
(
len1W
)
str1W
=
buf1W
;
else
...
...
@@ -3017,7 +3017,7 @@ INT WINAPI CompareStringA(LCID lcid, DWORD flags,
if
(
len2
)
{
len2W
=
MultiByteToWideChar
(
locale_cp
,
0
,
str2
,
len2
,
buf2W
,
130
);
if
(
len2
<=
130
)
len2W
=
MultiByteToWideChar
(
locale_cp
,
0
,
str2
,
len2
,
buf2W
,
130
);
if
(
len2W
)
str2W
=
buf2W
;
else
...
...
dlls/kernel32/tests/locale.c
View file @
aaed0e81
...
...
@@ -1466,7 +1466,6 @@ static void test_CompareStringA(void)
memset
(
a
,
'a'
,
sizeof
(
a
));
SetLastError
(
0xdeadbeef
);
ret
=
CompareStringA
(
lcid
,
0
,
a
,
sizeof
(
a
),
a
,
sizeof
(
a
));
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
&&
ret
==
CSTR_EQUAL
,
"ret %d, error %d, expected value %d
\n
"
,
ret
,
GetLastError
(),
CSTR_EQUAL
);
}
...
...
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