From bc5bb6a220d976d2fb0440adafd60fe558d6d130 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 26 May 2018 21:12:04 +0200 Subject: compat/tr: fix use-after-free #726 Found-by: Artem Sobolev --- compat/tr.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'compat') 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() {} -- cgit v1.2.3