]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ipc/mach_kernelrpc.c
xnu-4903.241.1.tar.gz
[apple/xnu.git] / osfmk / ipc / mach_kernelrpc.c
index 05fd050bbb8d743fe69a3fefc990640c3b5c9917..d251ab95cc918134719e08e1c3f5b76fde017838 100644 (file)
@@ -287,6 +287,12 @@ _kernelrpc_mach_port_get_attributes_trap(struct _kernelrpc_mach_port_get_attribu
        const mach_msg_type_number_t max_count = (sizeof(MACH_PORT_INFO_OUT)/sizeof(MACH_PORT_INFO_OUT[0]));
        typeof(MACH_PORT_INFO_OUT[0]) info[max_count];
 
+       /*
+        * zero out our stack buffer because not all flavors of
+        * port_get_attributes initialize the whole struct
+        */
+       bzero(info, sizeof(MACH_PORT_INFO_OUT));
+
        if (copyin(CAST_USER_ADDR_T(args->count), &count, sizeof(count))) {
                rv = MACH_SEND_INVALID_DATA;
                goto done;