From 207eddc3213419aab59674b45281e955c22b1b80 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Tue, 29 Jan 2019 15:18:03 +0200 Subject: [PATCH] Fix copy constructors of Callback objects ->move() operator was not touching unused data fields, therefore leaving uninitialised data and failing the comparison. Fixed by initialising all fields to zero before moving. --- platform/Callback.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/Callback.h b/platform/Callback.h index 52f6732c71..d021998b72 100644 --- a/platform/Callback.h +++ b/platform/Callback.h @@ -94,6 +94,7 @@ public: */ Callback(const Callback &func) { + memset(this, 0, sizeof(Callback)); if (func._ops) { func._ops->move(this, &func); } @@ -718,6 +719,7 @@ public: */ Callback(const Callback &func) { + memset(this, 0, sizeof(Callback)); if (func._ops) { func._ops->move(this, &func); } @@ -1343,6 +1345,7 @@ public: */ Callback(const Callback &func) { + memset(this, 0, sizeof(Callback)); if (func._ops) { func._ops->move(this, &func); } @@ -1969,6 +1972,7 @@ public: */ Callback(const Callback &func) { + memset(this, 0, sizeof(Callback)); if (func._ops) { func._ops->move(this, &func); } @@ -2596,6 +2600,7 @@ public: */ Callback(const Callback &func) { + memset(this, 0, sizeof(Callback)); if (func._ops) { func._ops->move(this, &func); } @@ -3224,6 +3229,7 @@ public: */ Callback(const Callback &func) { + memset(this, 0, sizeof(Callback)); if (func._ops) { func._ops->move(this, &func); }