From: CryptoManiac Date: Mon, 15 Feb 2016 18:23:11 +0000 (+0300) Subject: Add copy constructor to prevent undefined behaviour. X-Git-Tag: nvc-v0.5.6~74 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=6ca5afa667d15dc0de629290ba75bb6aa5697be0 Add copy constructor to prevent undefined behaviour. --- diff --git a/src/key.h b/src/key.h index 1ce14f8..38ebe76 100644 --- a/src/key.h +++ b/src/key.h @@ -218,6 +218,12 @@ private: public: CMalleablePubKey() { nVersion = CMalleablePubKey::CURRENT_VERSION; } + CMalleablePubKey(const CMalleablePubKey& mpk) + { + nVersion = mpk.nVersion; + pubKeyL = mpk.pubKeyL; + pubKeyH = mpk.pubKeyH; + } CMalleablePubKey(const std::string& strMalleablePubKey) { SetString(strMalleablePubKey); } CMalleablePubKey(const CPubKey &pubKeyInL, const CPubKey &pubKeyInH) : pubKeyL(pubKeyInL), pubKeyH(pubKeyInH) { nVersion = CMalleablePubKey::CURRENT_VERSION; } CMalleablePubKey(const std::vector &pubKeyInL, const std::vector &pubKeyInH) : pubKeyL(pubKeyInL), pubKeyH(pubKeyInH) { nVersion = CMalleablePubKey::CURRENT_VERSION; }