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
f59d0522
Commit
f59d0522
authored
Jun 13, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fix the returned error code for an invalid NT header offset.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47359
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
784b3f61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
loader.c
dlls/kernel32/tests/loader.c
+5
-0
mapping.c
server/mapping.c
+1
-1
No files found.
dlls/kernel32/tests/loader.c
View file @
f59d0522
...
@@ -1153,6 +1153,11 @@ static void test_Loader(void)
...
@@ -1153,6 +1153,11 @@ static void test_Loader(void)
}
}
((
IMAGE_OS2_HEADER
*
)
&
nt_header
)
->
ne_exetyp
=
((
IMAGE_OS2_HEADER
*
)
&
nt_header_template
)
->
ne_exetyp
;
((
IMAGE_OS2_HEADER
*
)
&
nt_header
)
->
ne_exetyp
=
((
IMAGE_OS2_HEADER
*
)
&
nt_header_template
)
->
ne_exetyp
;
dos_header
.
e_lfanew
=
0x98760000
;
status
=
map_image_section
(
&
nt_header
,
&
section
,
section_data
,
__LINE__
);
ok
(
status
==
STATUS_INVALID_IMAGE_PROTECT
,
"NtCreateSection error %08x
\n
"
,
status
);
dos_header
.
e_lfanew
=
sizeof
(
dos_header
);
nt_header
.
Signature
=
0xdeadbeef
;
nt_header
.
Signature
=
0xdeadbeef
;
status
=
map_image_section
(
&
nt_header
,
&
section
,
section_data
,
__LINE__
);
status
=
map_image_section
(
&
nt_header
,
&
section
,
section_data
,
__LINE__
);
ok
(
status
==
STATUS_INVALID_IMAGE_PROTECT
,
"NtCreateSection error %08x
\n
"
,
status
);
ok
(
status
==
STATUS_INVALID_IMAGE_PROTECT
,
"NtCreateSection error %08x
\n
"
,
status
);
...
...
server/mapping.c
View file @
f59d0522
...
@@ -593,7 +593,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
...
@@ -593,7 +593,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
pos
=
mz
.
dos
.
e_lfanew
;
pos
=
mz
.
dos
.
e_lfanew
;
size
=
pread
(
unix_fd
,
&
nt
,
sizeof
(
nt
),
pos
);
size
=
pread
(
unix_fd
,
&
nt
,
sizeof
(
nt
),
pos
);
if
(
size
<
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
))
return
STATUS_INVALID_IMAGE_
FORMA
T
;
if
(
size
<
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
))
return
STATUS_INVALID_IMAGE_
PROTEC
T
;
/* zero out Optional header in the case it's not present or partial */
/* zero out Optional header in the case it's not present or partial */
size
=
min
(
size
,
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
)
+
nt
.
FileHeader
.
SizeOfOptionalHeader
);
size
=
min
(
size
,
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
)
+
nt
.
FileHeader
.
SizeOfOptionalHeader
);
if
(
size
<
sizeof
(
nt
))
memset
(
(
char
*
)
&
nt
+
size
,
0
,
sizeof
(
nt
)
-
size
);
if
(
size
<
sizeof
(
nt
))
memset
(
(
char
*
)
&
nt
+
size
,
0
,
sizeof
(
nt
)
-
size
);
...
...
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