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
737b5b95
Commit
737b5b95
authored
Dec 27, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use pread instead of read in elf_map_file.
parent
65524735
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
elf_module.c
dlls/dbghelp/elf_module.c
+4
-4
No files found.
dlls/dbghelp/elf_module.c
View file @
737b5b95
...
...
@@ -269,10 +269,10 @@ static BOOL elf_map_file(const WCHAR* filenameW, struct image_file_map* fmap)
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
*
sizeof
(
fmap
->
u
.
elf
.
sect
[
0
]));
if
(
!
fmap
->
u
.
elf
.
sect
)
goto
done
;
lseek
(
fmap
->
u
.
elf
.
fd
,
fmap
->
u
.
elf
.
elfhdr
.
e_shoff
,
SEEK_SET
);
for
(
i
=
0
;
i
<
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
;
i
++
)
{
if
(
read
(
fmap
->
u
.
elf
.
fd
,
&
fmap
->
u
.
elf
.
sect
[
i
].
shdr
,
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
))
!=
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
))
if
(
pread
(
fmap
->
u
.
elf
.
fd
,
&
fmap
->
u
.
elf
.
sect
[
i
].
shdr
,
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
),
fmap
->
u
.
elf
.
elfhdr
.
e_shoff
+
i
*
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
))
!=
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
))
{
HeapFree
(
GetProcessHeap
(),
0
,
fmap
->
u
.
elf
.
sect
);
fmap
->
u
.
elf
.
sect
=
NULL
;
...
...
@@ -282,12 +282,12 @@ static BOOL elf_map_file(const WCHAR* filenameW, struct image_file_map* fmap)
}
/* grab size of module once loaded in memory */
lseek
(
fmap
->
u
.
elf
.
fd
,
fmap
->
u
.
elf
.
elfhdr
.
e_phoff
,
SEEK_SET
);
fmap
->
u
.
elf
.
elf_size
=
0
;
fmap
->
u
.
elf
.
elf_start
=
~
0L
;
for
(
i
=
0
;
i
<
fmap
->
u
.
elf
.
elfhdr
.
e_phnum
;
i
++
)
{
if
(
read
(
fmap
->
u
.
elf
.
fd
,
&
phdr
,
sizeof
(
phdr
))
==
sizeof
(
phdr
)
&&
if
(
pread
(
fmap
->
u
.
elf
.
fd
,
&
phdr
,
sizeof
(
phdr
),
fmap
->
u
.
elf
.
elfhdr
.
e_phoff
+
i
*
sizeof
(
phdr
))
==
sizeof
(
phdr
)
&&
phdr
.
p_type
==
PT_LOAD
)
{
tmp
=
(
phdr
.
p_vaddr
+
phdr
.
p_memsz
+
page_mask
)
&
~
page_mask
;
...
...
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