summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-09-11 12:05:04 +0200
committerJustus Winter <justus@gnupg.org>2016-09-11 12:05:04 +0200
commit25d5ceed31dd5e9256ebb4479397bfb5eed78155 (patch)
tree82ef3507e893c95c2c0687745a20231172b6a6a9
parente5c7d1c1dda40f8f262e26fed911bfe03027993b (diff)
ipc: Fix crash in debug code.
* ipc/mach_debug.c (mach_port_kernel_object): Check that the receiver is valid.
-rw-r--r--ipc/mach_debug.c3
1 files changed, 3 insertions, 0 deletions
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;