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
dccc4283
Commit
dccc4283
authored
May 15, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
May 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleacc: Don't return partial data in GetRoleTextA if buffer is too small.
parent
1f6ade45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
main.c
dlls/oleacc/main.c
+6
-0
main.c
dlls/oleacc/tests/main.c
+7
-4
No files found.
dlls/oleacc/main.c
View file @
dccc4283
...
...
@@ -396,6 +396,12 @@ UINT WINAPI GetRoleTextA(DWORD role, LPSTR lpRole, UINT rolemax)
return
length
-
1
;
}
if
(
rolemax
<
length
)
{
HeapFree
(
GetProcessHeap
(),
0
,
roletextW
);
lpRole
[
0
]
=
0
;
return
0
;
}
WideCharToMultiByte
(
CP_ACP
,
0
,
roletextW
,
-
1
,
lpRole
,
rolemax
,
NULL
,
NULL
);
if
(
rolemax
<
length
){
...
...
dlls/oleacc/tests/main.c
View file @
dccc4283
...
...
@@ -87,13 +87,16 @@ static void test_getroletext(void)
ret
=
GetRoleTextA
(
ROLE_SYSTEM_TITLEBAR
,
buf
,
1
);
ok
(
ret
==
0
,
"GetRoleTextA returned wrong length
\n
"
);
ok
(
buf
[
0
]
==
'\0'
,
"GetRoleTextA returned not zero-length buffer
\n
"
);
buf
[
1
]
=
'*'
;
buf
[
0
]
=
'*'
;
ret
=
GetRoleTextA
(
ROLE_SYSTEM_TITLEBAR
,
buf
,
2
);
ok
(
ret
==
1
||
ok
(
broken
(
ret
==
1
)
||
ret
==
0
,
/* Vista and W2K8 */
"GetRoleTextA returned wrong length, got %d, expected 0 or 1
\n
"
,
ret
);
if
(
ret
==
1
)
ok
(
buf
[
1
]
==
'\0'
,
"GetRoleTextA returned not zero-length buffer : (%c)
\n
"
,
buf
[
1
]);
if
(
ret
==
0
)
{
ok
(
!
buf
[
0
]
||
broken
(
buf
[
0
]
!=
'*'
)
/* WinXP */
,
"GetRoleTextA returned not zero-length buffer : (%c)
\n
"
,
buf
[
0
]);
}
bufW
[
0
]
=
'*'
;
ret
=
GetRoleTextW
(
ROLE_SYSTEM_TITLEBAR
,
bufW
,
1
);
...
...
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