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
2e0a96a4
Commit
2e0a96a4
authored
Apr 23, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make sure that the virtual heap doesn't overlap the preloader range.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50963
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
126a14ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
virtual.c
dlls/ntdll/unix/virtual.c
+14
-2
No files found.
dlls/ntdll/unix/virtual.c
View file @
2e0a96a4
...
...
@@ -2575,11 +2575,23 @@ struct alloc_virtual_heap
static
int
CDECL
alloc_virtual_heap
(
void
*
base
,
SIZE_T
size
,
void
*
arg
)
{
struct
alloc_virtual_heap
*
alloc
=
arg
;
void
*
end
=
(
char
*
)
base
+
size
;
if
(
is_beyond_limit
(
base
,
size
,
address_space_limit
))
address_space_limit
=
(
char
*
)
base
+
size
;
if
(
size
<
alloc
->
size
)
return
0
;
if
(
is_win64
&&
base
<
(
void
*
)
0x80000000
)
return
0
;
alloc
->
base
=
anon_mmap_fixed
(
(
char
*
)
base
+
size
-
alloc
->
size
,
alloc
->
size
,
PROT_READ
|
PROT_WRITE
,
0
);
if
(
preload_reserve_end
>=
end
)
{
if
(
preload_reserve_start
<=
base
)
return
0
;
/* no space in that area */
if
(
preload_reserve_start
<
end
)
end
=
preload_reserve_start
;
}
else
if
(
preload_reserve_end
>
base
)
{
if
(
preload_reserve_start
<=
base
)
base
=
preload_reserve_end
;
else
if
((
char
*
)
end
-
(
char
*
)
preload_reserve_end
>=
alloc
->
size
)
base
=
preload_reserve_end
;
else
end
=
preload_reserve_start
;
}
if
((
char
*
)
end
-
(
char
*
)
base
<
alloc
->
size
)
return
0
;
alloc
->
base
=
anon_mmap_fixed
(
(
char
*
)
end
-
alloc
->
size
,
alloc
->
size
,
PROT_READ
|
PROT_WRITE
,
0
);
return
(
alloc
->
base
!=
MAP_FAILED
);
}
...
...
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