From 25d5ceed31dd5e9256ebb4479397bfb5eed78155 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Sun, 11 Sep 2016 12:05:04 +0200 Subject: ipc: Fix crash in debug code. * ipc/mach_debug.c (mach_port_kernel_object): Check that the receiver is valid. --- ipc/mach_debug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipc/mach_debug.c b/ipc/mach_debug.c index efb07a4f..6ddc89b2 100644 --- a/ipc/mach_debug.c +++ b/ipc/mach_debug.c @@ -257,6 +257,9 @@ mach_port_kernel_object( ipc_port_t port; kern_return_t kr; + if (space == IS_NULL) + return KERN_INVALID_TASK; + kr = ipc_right_lookup_read(space, name, &entry); if (kr != KERN_SUCCESS) return kr; -- cgit v1.2.3