From 0f00932955521c3c2fb8140176ab72f22172c298 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Fri, 26 Feb 2021 14:51:13 +0100
Subject: Started UBSan and stack-smashing check support

---
 libgui/msg.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

(limited to 'libgui')

diff --git a/libgui/msg.c b/libgui/msg.c
index 4576a5f..8448e73 100644
--- a/libgui/msg.c
+++ b/libgui/msg.c
@@ -5,18 +5,17 @@
 #include <print.h>
 #include <sys.h>
 
-static struct message msg_buf = { 0 };
-
 int msg_send(u32 pid, enum message_type type, void *data)
 {
+	struct message msg = { 0 };
 	assert((signed)pid != -1);
 	char path[32] = { 0 };
 	sprintf(path, "/proc/%d/msg", pid);
-	msg_buf.magic = MSG_MAGIC;
-	msg_buf.src = getpid();
-	msg_buf.type = type;
-	msg_buf.data = data;
-	return write(path, &msg_buf, 0, sizeof(msg_buf));
+	msg.magic = MSG_MAGIC;
+	msg.src = getpid();
+	msg.type = type;
+	msg.data = data;
+	return write(path, &msg, 0, sizeof(msg));
 }
 
 int msg_receive(struct message *msg)
-- 
cgit v1.2.3