Commit 31b02bbd authored by Alexandre Julliard's avatar Alexandre Julliard

server: Avoid crash in alloc_console when the process has no parent.

parent f9cbc4c7
......@@ -1252,12 +1252,20 @@ DECL_HANDLER(alloc_console)
struct process *renderer = current->process;
struct console_input *console;
process = (req->pid) ? get_process_from_id( req->pid ) :
(struct process *)grab_object( renderer->parent );
if (req->pid)
{
if (!(process = get_process_from_id( req->pid ))) return;
}
else
{
if (!(process = renderer->parent))
{
set_error( STATUS_ACCESS_DENIED );
return;
}
grab_object( process );
}
reply->handle_in = 0;
reply->event = 0;
if (!process) return;
if (process != renderer && process->console)
{
set_error( STATUS_ACCESS_DENIED );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment