From: Alex Rousskov Date: Fri, 6 Jul 2018 23:58:22 +0000 (+0000) Subject: Bug 4865: Unexpected exception on startup in TypedMsgHdr::sync() (#242) X-Git-Tag: M-staged-PR242 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=914599e33db01dbc6dee465ee498814b19bcf09a;p=thirdparty%2Fsquid.git 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. --- 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;