From a4ef65281814b18fdd1ac5457d3e219347ec6cb8 Mon Sep 17 00:00:00 2001 From: Pieter de Visser Date: Mon, 8 Apr 2024 09:05:23 +0200 Subject: [PATCH] Initialize all bytes passed to write() (#82) --- lib/linux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/linux.cpp b/lib/linux.cpp index bd01e5a9..5a5561a8 100644 --- a/lib/linux.cpp +++ b/lib/linux.cpp @@ -73,6 +73,7 @@ namespace cppcoro bool message_queue::enqueue_message(void* msg, message_type type) { message qmsg; + std::memset(&qmsg, 0, sizeof(qmsg)); qmsg.m_type = type; qmsg.m_ptr = msg; int status = write(m_pipefd[1], (const char*)&qmsg, sizeof(message));