diff --git a/src/key.cpp b/src/key.cpp index 8a1bfef771a..7fcb17d574f 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -376,6 +376,9 @@ bool CKey::SetCompactSignature(uint256 hash, const std::vector& v bool CKey::Verify(uint256 hash, const std::vector& vchSig) { + if (vchSig.empty()) + return false; + // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first. unsigned char *norm_der = NULL; ECDSA_SIG *norm_sig = ECDSA_SIG_new();