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
8c375c7f
Commit
8c375c7f
authored
Aug 12, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't map data beyond the virtual size of a section.
parent
8e5c32ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
virtual.c
dlls/ntdll/virtual.c
+6
-4
No files found.
dlls/ntdll/virtual.c
View file @
8c375c7f
...
...
@@ -931,10 +931,11 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
goto
error
;
}
size
=
ROUND_SIZE
(
0
,
sec
->
Misc
.
VirtualSize
);
if
((
sec
->
Characteristics
&
IMAGE_SCN_MEM_SHARED
)
&&
(
sec
->
Characteristics
&
IMAGE_SCN_MEM_WRITE
))
{
size
=
ROUND_SIZE
(
0
,
sec
->
Misc
.
VirtualSize
);
TRACE_
(
module
)(
"mapping shared section %.8s at %p off %lx (%x) size %lx (%lx) flags %lx
\n
"
,
sec
->
Name
,
ptr
+
sec
->
VirtualAddress
,
sec
->
PointerToRawData
,
(
int
)
pos
,
sec
->
SizeOfRawData
,
...
...
@@ -964,17 +965,18 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
continue
;
}
TRACE_
(
module
)(
"mapping section %.8s at %p off %lx size %lx flags %lx
\n
"
,
TRACE_
(
module
)(
"mapping section %.8s at %p off %lx size %lx
virt %lx
flags %lx
\n
"
,
sec
->
Name
,
ptr
+
sec
->
VirtualAddress
,
sec
->
PointerToRawData
,
sec
->
SizeOfRawData
,
sec
->
Characteristics
);
s
ize
,
s
ec
->
Characteristics
);
if
(
!
sec
->
PointerToRawData
||
!
sec
->
SizeOfRawData
)
continue
;
if
(
sec
->
SizeOfRawData
<
size
)
size
=
sec
->
SizeOfRawData
;
/* Note: if the section is not aligned properly map_file_into_view will magically
* fall back to read(), so we don't need to check anything here.
*/
if
(
map_file_into_view
(
view
,
fd
,
sec
->
VirtualAddress
,
s
ec
->
SizeOfRawData
,
sec
->
PointerToRawData
,
if
(
map_file_into_view
(
view
,
fd
,
sec
->
VirtualAddress
,
s
ize
,
sec
->
PointerToRawData
,
VPROT_COMMITTED
|
VPROT_READ
|
VPROT_WRITECOPY
,
removable
)
!=
STATUS_SUCCESS
)
{
...
...
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