Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DavidCurtiss
wine
Commits
1c99af4a
Commit
1c99af4a
authored
24 years ago
by
Andreas Mohr
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Check the attributes of the *current* section, not only the attributes
of the *first* section...
parent
9e1fda18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/mapping.c
+10
-3
10 additions, 3 deletions
server/mapping.c
with
10 additions
and
3 deletions
server/mapping.c
+
10
−
3
View file @
1c99af4a
...
...
@@ -95,6 +95,7 @@ static int build_shared_mapping( struct mapping *mapping, int fd,
int
i
,
max_size
,
total_size
,
pos
;
char
*
buffer
=
NULL
;
int
shared_fd
=
-
1
;
long
toread
;
/* compute the total size of the shared mapping */
...
...
@@ -127,10 +128,16 @@ static int build_shared_mapping( struct mapping *mapping, int fd,
if
(
!
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_MEM_WRITE
))
continue
;
if
(
lseek
(
shared_fd
,
pos
,
SEEK_SET
)
!=
pos
)
goto
error
;
pos
+=
ROUND_SIZE
(
0
,
sec
[
i
].
Misc
.
VirtualSize
);
if
(
sec
->
Characteristics
&
IMAGE_SCN_CNT_UNINITIALIZED_DATA
)
continue
;
if
(
!
sec
->
PointerToRawData
||
!
sec
->
SizeOfRawData
)
continue
;
if
(
sec
[
i
].
Characteristics
&
IMAGE_SCN_CNT_UNINITIALIZED_DATA
)
continue
;
if
(
!
sec
[
i
].
PointerToRawData
||
!
sec
[
i
].
SizeOfRawData
)
continue
;
if
(
lseek
(
fd
,
sec
[
i
].
PointerToRawData
,
SEEK_SET
)
!=
sec
[
i
].
PointerToRawData
)
goto
error
;
if
(
read
(
fd
,
buffer
,
sec
[
i
].
SizeOfRawData
)
!=
sec
[
i
].
SizeOfRawData
)
goto
error
;
toread
=
sec
[
i
].
SizeOfRawData
;
while
(
toread
)
{
long
res
=
read
(
fd
,
buffer
+
sec
[
i
].
SizeOfRawData
-
toread
,
toread
);
if
(
res
<=
0
)
goto
error
;
toread
-=
res
;
}
if
(
write
(
shared_fd
,
buffer
,
sec
[
i
].
SizeOfRawData
)
!=
sec
[
i
].
SizeOfRawData
)
goto
error
;
}
close
(
shared_fd
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment