diff options
Diffstat (limited to 'src/keystore.cpp')
-rw-r--r-- | src/keystore.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/keystore.cpp b/src/keystore.cpp index 46402ea25b..594e0c61da 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -33,6 +33,9 @@ bool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey) bool CBasicKeyStore::AddCScript(const CScript& redeemScript) { + if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) + return error("CBasicKeyStore::AddCScript() : redeemScripts > %i bytes are invalid", MAX_SCRIPT_ELEMENT_SIZE); + LOCK(cs_KeyStore); mapScripts[redeemScript.GetID()] = redeemScript; return true; |