]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4865: Unexpected exception on startup in TypedMsgHdr::sync() (#242) M-staged-PR242
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 6 Jul 2018 23:58:22 +0000 (23:58 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 8 Jul 2018 16:35:19 +0000 (16:35 +0000)
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

index 68bc2eed270e4b4581e2d71d903e47f97f793110..e9165dc444337564180ccd835d0bca6dba50773a 100644 (file)
@@ -32,8 +32,8 @@ Ipc::TypedMsgHdr &Ipc::TypedMsgHdr::operator =(const TypedMsgHdr &tmh)
 {
     if (this != &tmh) { // skip assignment to self
         memcpy(static_cast<msghdr*>(this), static_cast<const msghdr*>(&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;