From 60c51f1c381bbd93c70cfdf41c6688609a7956fc Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 10 Jan 2015 08:58:47 +0100 Subject: [PATCH] fail immediately on an empty signature Github-Pull: #5634 Rebased-From: 8dccba6a45db0466370726ed462b9da2eae43bce --- src/key.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/key.cpp b/src/key.cpp index e5943af79..a845ba13d 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -227,6 +227,9 @@ public: } bool 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();