diff --git a/bitcoin/signature.c b/bitcoin/signature.c index 4de412dea..3f2dc18da 100644 --- a/bitcoin/signature.c +++ b/bitcoin/signature.c @@ -197,7 +197,7 @@ static bool IsValidSignatureEncoding(const unsigned char sig[], size_t len) // Verify that the length of the signature matches the sum of the length // of the elements. - if ((size_t)(lenR + lenS + 7) != len) return false; + if ((size_t)lenR + (size_t)lenS + 7 != len) return false; // Check whether the R element is an integer. if (sig[2] != 0x02) return false;