diff --git a/libdevcore/FixedHash.h b/libdevcore/FixedHash.h index e0125b005..973bc174e 100644 --- a/libdevcore/FixedHash.h +++ b/libdevcore/FixedHash.h @@ -238,7 +238,14 @@ public: explicit SecureFixedHash(bytes const* _d, ConstructFromPointerType _t): FixedHash(_d, _t) {} ~SecureFixedHash() { ref().cleanse(); } - SecureFixedHash& operator=(SecureFixedHash const& _c) { ref().cleanse(); FixedHash::operator=(static_cast const&>(_c)); return *this; } + SecureFixedHash& operator=(SecureFixedHash const& _c) + { + if (&_c == this) + return *this; + ref().cleanse(); + FixedHash::operator=(static_cast const&>(_c)); + return *this; + } using FixedHash::size;