diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-05-26 21:12:04 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-05-26 21:12:04 +0200 |
commit | bc5bb6a220d976d2fb0440adafd60fe558d6d130 (patch) | |
tree | 4b3b1de2c8cfd834fdeefb49ced525a971cf5fc3 | |
parent | db70995366e465b002cbb7611e19c1f8f012203a (diff) |
compat/tr: fix use-after-free #726
Found-by: Artem Sobolev
-rw-r--r-- | compat/tr.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/compat/tr.cpp b/compat/tr.cpp index 7cff52a9..72e02527 100644 --- a/compat/tr.cpp +++ b/compat/tr.cpp @@ -5,13 +5,9 @@ TR::TR() : QObject(nullptr) {} TR::TR(const TR&) : QObject(nullptr) {} -TR& TR::operator=(const TR& other) +TR& TR::operator=(const TR&) { - if (this == &other) - return *this; - - this->~TR(); - return *new (this) TR; + return *this; } TR::~TR() {} |