aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-10 08:58:47 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-10 08:58:47 +0100
commit60c51f1c381bbd93c70cfdf41c6688609a7956fc (patch)
tree14deb6d505cffb4e5b96ed4af54961e6925548cf
parentf047dfa7df01c0cd4f655e3c2fce542bfe4011dc (diff)
downloadbitcoin-60c51f1c381bbd93c70cfdf41c6688609a7956fc.tar.xz
fail immediately on an empty signature
Github-Pull: #5634 Rebased-From: 8dccba6a45db0466370726ed462b9da2eae43bce
-rw-r--r--src/key.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/key.cpp b/src/key.cpp
index e5943af79a..a845ba13d1 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -227,6 +227,9 @@ public:
}
bool Verify(const uint256 &hash, const std::vector<unsigned char>& 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();