---
 ipc/ipc_kmsg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c
index 1b98445d..fb8de249 100644
--- a/ipc/ipc_kmsg.c
+++ b/ipc/ipc_kmsg.c
@@ -2385,7 +2385,8 @@ ipc_kmsg_copyout_body(
                                /* first allocate memory in the map */
                                uint64_t allocated = length;
 
-                               assert(sizeof(mach_port_name_t) < 
sizeof(mach_port_t));
+                               _Static_assert(sizeof(mach_port_name_t) <= 
sizeof(mach_port_t),
+                                               "Size of mach_port_t should be 
equal or larger than mach_port_name_t.");
                                allocated -= (sizeof(mach_port_t) - 
sizeof(mach_port_name_t)) * number;
 
                                kr = vm_allocate(map, &addr, allocated, TRUE);
-- 
2.39.2


Reply via email to