aboutsummaryrefslogtreecommitdiff
path: root/libgui/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgui/msg.c')
-rw-r--r--libgui/msg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgui/msg.c b/libgui/msg.c
index 3f58267..677ad52 100644
--- a/libgui/msg.c
+++ b/libgui/msg.c
@@ -1,12 +1,15 @@
// MIT License, Copyright (c) 2021 Marvin Borner
#include <assert.h>
+#include <errno.h>
#include <msg.h>
#include <print.h>
#include <sys.h>
int msg_send(u32 pid, enum message_type type, void *data, u32 size)
{
+ if (!data)
+ return -EFAULT;
assert((signed)pid != -1 && size >= sizeof(struct message_header));
char path[32] = { 0 };
sprintf(path, "/proc/%d/msg", pid);