Merge pull request #10744 from OatmealDome/ventura-exception
MemTools: Always provide a valid pointer in send_msg for mach_msg_overwrite
This commit is contained in:
commit
f1993182f0
|
@ -157,7 +157,6 @@ static void ExceptionThread(mach_port_t port)
|
|||
#pragma pack()
|
||||
memset(&msg_in, 0xee, sizeof(msg_in));
|
||||
memset(&msg_out, 0xee, sizeof(msg_out));
|
||||
mach_msg_header_t* send_msg = nullptr;
|
||||
mach_msg_size_t send_size = 0;
|
||||
mach_msg_option_t option = MACH_RCV_MSG;
|
||||
while (true)
|
||||
|
@ -167,7 +166,7 @@ static void ExceptionThread(mach_port_t port)
|
|||
// thread_set_exception_ports, or MACH_NOTIFY_NO_SENDERS due to
|
||||
// mach_port_request_notification.
|
||||
CheckKR("mach_msg_overwrite",
|
||||
mach_msg_overwrite(send_msg, option, send_size, sizeof(msg_in), port,
|
||||
mach_msg_overwrite(&msg_out.Head, option, send_size, sizeof(msg_in), port,
|
||||
MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL, &msg_in.Head, 0));
|
||||
|
||||
if (msg_in.Head.msgh_id == MACH_NOTIFY_NO_SENDERS)
|
||||
|
@ -216,7 +215,6 @@ static void ExceptionThread(mach_port_t port)
|
|||
msg_out.Head.msgh_size =
|
||||
offsetof(__typeof__(msg_out), new_state) + msg_out.new_stateCnt * sizeof(natural_t);
|
||||
|
||||
send_msg = &msg_out.Head;
|
||||
send_size = msg_out.Head.msgh_size;
|
||||
option |= MACH_SEND_MSG;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue