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
7378fac5
Commit
7378fac5
authored
Aug 20, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Return an error instead of dying in wine_server_call if the input buffer is invalid.
parent
0ce71870
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
server.c
dlls/ntdll/server.c
+10
-7
No files found.
dlls/ntdll/server.c
View file @
7378fac5
...
...
@@ -219,7 +219,7 @@ void server_protocol_perror( const char *err )
*
* Send a request to the server.
*/
static
void
send_request
(
const
struct
__server_request_info
*
req
)
static
unsigned
int
send_request
(
const
struct
__server_request_info
*
req
)
{
unsigned
int
i
;
int
ret
;
...
...
@@ -227,7 +227,7 @@ static void send_request( const struct __server_request_info *req )
if
(
!
req
->
u
.
req
.
request_header
.
request_size
)
{
if
((
ret
=
write
(
ntdll_get_thread_data
()
->
request_fd
,
&
req
->
u
.
req
,
sizeof
(
req
->
u
.
req
)
))
==
sizeof
(
req
->
u
.
req
))
return
;
sizeof
(
req
->
u
.
req
)
))
==
sizeof
(
req
->
u
.
req
))
return
STATUS_SUCCESS
;
}
else
...
...
@@ -242,11 +242,12 @@ static void send_request( const struct __server_request_info *req )
vec
[
i
+
1
].
iov_len
=
req
->
data
[
i
].
size
;
}
if
((
ret
=
writev
(
ntdll_get_thread_data
()
->
request_fd
,
vec
,
i
+
1
))
==
req
->
u
.
req
.
request_header
.
request_size
+
sizeof
(
req
->
u
.
req
))
return
;
req
->
u
.
req
.
request_header
.
request_size
+
sizeof
(
req
->
u
.
req
))
return
STATUS_SUCCESS
;
}
if
(
ret
>=
0
)
server_protocol_error
(
"partial write %d
\n
"
,
ret
);
if
(
errno
==
EPIPE
)
server_abort_thread
(
0
);
if
(
errno
==
EFAULT
)
return
STATUS_ACCESS_VIOLATION
;
server_protocol_perror
(
"write"
);
}
...
...
@@ -283,11 +284,12 @@ static void read_reply_data( void *buffer, size_t size )
*
* Wait for a reply from the server.
*/
static
inline
void
wait_reply
(
struct
__server_request_info
*
req
)
static
inline
unsigned
int
wait_reply
(
struct
__server_request_info
*
req
)
{
read_reply_data
(
&
req
->
u
.
reply
,
sizeof
(
req
->
u
.
reply
)
);
if
(
req
->
u
.
reply
.
reply_header
.
reply_size
)
read_reply_data
(
req
->
reply_data
,
req
->
u
.
reply
.
reply_header
.
reply_size
);
return
req
->
u
.
reply
.
reply_header
.
error
;
}
...
...
@@ -317,12 +319,13 @@ unsigned int wine_server_call( void *req_ptr )
{
struct
__server_request_info
*
const
req
=
req_ptr
;
sigset_t
old_set
;
unsigned
int
ret
;
pthread_functions
.
sigprocmask
(
SIG_BLOCK
,
&
server_block_set
,
&
old_set
);
send_request
(
req
);
wait_reply
(
req
);
ret
=
send_request
(
req
);
if
(
!
ret
)
ret
=
wait_reply
(
req
);
pthread_functions
.
sigprocmask
(
SIG_SETMASK
,
&
old_set
,
NULL
);
return
re
q
->
u
.
reply
.
reply_header
.
error
;
return
re
t
;
}
...
...
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