From 8dccba6a45db0466370726ed462b9da2eae43bce Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 9 Jan 2015 22:06:08 -0500 Subject: [PATCH] fail immediately on an empty signature --- src/ecwrapper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ecwrapper.cpp b/src/ecwrapper.cpp index 33dd9a9a2..0236e90c1 100644 --- a/src/ecwrapper.cpp +++ b/src/ecwrapper.cpp @@ -117,6 +117,9 @@ bool CECKey::SetPubKey(const unsigned char* pubkey, size_t size) { } bool CECKey::Verify(const 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();