Skip to content

Commit

Permalink
Initialize all bytes passed to write() (andreasbuhr#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
urlofmar committed Apr 8, 2024
1 parent 244f834 commit 9afd2c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9afd2c5

Please sign in to comment.