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
e8ce9979
Commit
e8ce9979
authored
Sep 14, 2023
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add ACTCTX field limit checks to CreateActCtxA().
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
54479863
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
process.c
dlls/kernel32/process.c
+9
-1
actctx.c
dlls/kernel32/tests/actctx.c
+0
-2
No files found.
dlls/kernel32/process.c
View file @
e8ce9979
...
...
@@ -422,11 +422,19 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateActCtxA( const ACTCTXA *actctx )
TRACE
(
"%p %08lx
\n
"
,
actctx
,
actctx
?
actctx
->
dwFlags
:
0
);
if
(
!
actctx
||
actctx
->
cbSize
!=
sizeof
(
*
actctx
))
#define CHECK_LIMIT( field ) (actctx->cbSize >= RTL_SIZEOF_THROUGH_FIELD( ACTCTXA, field ))
if
(
!
actctx
||
!
CHECK_LIMIT
(
lpSource
)
||
((
actctx
->
dwFlags
&
ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID
)
&&
!
CHECK_LIMIT
(
wProcessorArchitecture
))
||
((
actctx
->
dwFlags
&
ACTCTX_FLAG_LANGID_VALID
)
&&
!
CHECK_LIMIT
(
wLangId
))
||
((
actctx
->
dwFlags
&
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID
)
&&
!
CHECK_LIMIT
(
lpAssemblyDirectory
))
||
((
actctx
->
dwFlags
&
ACTCTX_FLAG_RESOURCE_NAME_VALID
)
&&
!
CHECK_LIMIT
(
lpResourceName
))
||
((
actctx
->
dwFlags
&
ACTCTX_FLAG_APPLICATION_NAME_VALID
)
&&
!
CHECK_LIMIT
(
lpApplicationName
))
||
((
actctx
->
dwFlags
&
ACTCTX_FLAG_HMODULE_VALID
)
&&
!
CHECK_LIMIT
(
hModule
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
#undef CHECK_LIMIT
actw
.
cbSize
=
sizeof
(
actw
);
actw
.
dwFlags
=
actctx
->
dwFlags
;
...
...
dlls/kernel32/tests/actctx.c
View file @
e8ce9979
...
...
@@ -2895,7 +2895,6 @@ static void test_CreateActCtx(void)
handle
=
CreateActCtxA
(
&
actctx
);
if
(
!
test
[
i
].
error
)
{
todo_wine
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"CreateActCtx error %lu
\n
"
,
GetLastError
());
ReleaseActCtx
(
handle
);
}
...
...
@@ -2910,7 +2909,6 @@ static void test_CreateActCtx(void)
actctx
.
lpSource
=
source
;
/* source without hModule must point to valid PE */
SetLastError
(
0xdeadbeef
);
handle
=
CreateActCtxA
(
&
actctx
);
todo_wine_if
(
i
!=
4
)
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"CreateActCtx error %lu
\n
"
,
GetLastError
());
ReleaseActCtx
(
handle
);
...
...
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