From 6ca5afa667d15dc0de629290ba75bb6aa5697be0 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Mon, 15 Feb 2016 21:23:11 +0300 Subject: [PATCH] Add copy constructor to prevent undefined behaviour. --- src/key.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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; } -- 1.7.1