aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentf047dfa7df01c0cd4f655e3c2fce542bfe4011dc (diff)
fail immediately on an empty signature
Github-Pull: #5634 Rebased-From: 8dccba6a45db0466370726ed462b9da2eae43bce
Diffstat (limited to 'src')
-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();