From 914599e33db01dbc6dee465ee498814b19bcf09a Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Fri, 6 Jul 2018 23:58:22 +0000 Subject: [PATCH] Bug 4865: Unexpected exception on startup in TypedMsgHdr::sync() (#242) Commit b56b37c broke Ipc::TypedMsgHdr copying by incorrectly assuming that sync() sets name and ios members. The sync() method sets _other_ (low level) members based on name and ios. --- src/ipc/TypedMsgHdr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipc/TypedMsgHdr.cc b/src/ipc/TypedMsgHdr.cc index 68bc2eed27..e9165dc444 100644 --- a/src/ipc/TypedMsgHdr.cc +++ b/src/ipc/TypedMsgHdr.cc @@ -32,8 +32,8 @@ Ipc::TypedMsgHdr &Ipc::TypedMsgHdr::operator =(const TypedMsgHdr &tmh) { if (this != &tmh) { // skip assignment to self memcpy(static_cast(this), static_cast(&tmh), sizeof(msghdr)); - // struct name is handled in sync() - // struct ios[] is handled in sync() + name = tmh.name; + memcpy(&ios, &tmh.ios, sizeof(ios)); data = tmh.data; ctrl = tmh.ctrl; offset = tmh.offset; -- 2.47.3