From b63dea5ca946c3956637a7bf85a1002866b20cd6 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Oct 2023 17:35:01 +0200 Subject: copyinmsg: Check that we have not overflown This if of course too late in case of a failure, but better assert than get awful bugs, and it's really not supposed to happen. --- ipc/ipc_kmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipc/ipc_kmsg.c') diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c index 105e54d4..33e4d57c 100644 --- a/ipc/ipc_kmsg.c +++ b/ipc/ipc_kmsg.c @@ -505,7 +505,7 @@ ipc_kmsg_get( ikm_init(kmsg, ksize); } - if (copyinmsg(msg, &kmsg->ikm_header, size)) { + if (copyinmsg(msg, &kmsg->ikm_header, size, kmsg->ikm_size)) { ikm_free(kmsg); return MACH_SEND_INVALID_DATA; } -- cgit v1.2.3