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
a257ba24
Commit
a257ba24
authored
Aug 16, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid going past the end of the relocation section. Skip sanity checks
for empty relocation blocks.
parent
587cc122
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
pe_image.c
loader/pe_image.c
+4
-2
No files found.
loader/pe_image.c
View file @
a257ba24
...
...
@@ -421,11 +421,14 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f
if
((
nt
->
OptionalHeader
.
ImageBase
&
0x80000000
)
&&
!
((
DWORD
)
base
&
0x80000000
))
ERR
(
"Forced to relocate system DLL (base > 2GB). This is not good.
\n
"
);
while
(
rel
->
VirtualAddress
)
for
(
;
((
char
*
)
rel
<
base
+
dir
->
VirtualAddress
+
dir
->
Size
)
&&
rel
->
VirtualAddress
;
rel
=
(
IMAGE_BASE_RELOCATION
*
)((
char
*
)
rel
+
rel
->
SizeOfBlock
))
{
char
*
page
=
base
+
rel
->
VirtualAddress
;
int
i
,
count
=
(
rel
->
SizeOfBlock
-
8
)
/
sizeof
(
rel
->
TypeOffset
);
if
(
!
count
)
continue
;
/* sanity checks */
if
((
char
*
)
rel
+
rel
->
SizeOfBlock
>
base
+
dir
->
VirtualAddress
+
dir
->
Size
||
page
>
base
+
nt
->
OptionalHeader
.
SizeOfImage
)
...
...
@@ -462,7 +465,6 @@ static int do_relocations( char *base, const IMAGE_NT_HEADERS *nt, const char *f
break
;
}
}
rel
=
(
IMAGE_BASE_RELOCATION
*
)((
char
*
)
rel
+
rel
->
SizeOfBlock
);
}
return
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