diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-06-09 13:39:09 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-06-09 13:39:09 -0700 |
commit | 8903a1a0a78a705402123d2a5c465217cb9d791c (patch) | |
tree | 0b03f9c68f9d9b0568f678804fbebe997e5fc549 /src/secp256k1/contrib/lax_der_parsing.c | |
parent | 9ad6f14175c19b5d47267c3dd5840c14bad43c83 (diff) | |
parent | 67f232b5d874b501c114bced5d764db7f4f5ce99 (diff) | |
download | bitcoin-8903a1a0a78a705402123d2a5c465217cb9d791c.tar.xz |
Update src/secp256k1 subtree
Diffstat (limited to 'src/secp256k1/contrib/lax_der_parsing.c')
-rw-r--r-- | src/secp256k1/contrib/lax_der_parsing.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/secp256k1/contrib/lax_der_parsing.c b/src/secp256k1/contrib/lax_der_parsing.c index 5b141a9948..e177a0562d 100644 --- a/src/secp256k1/contrib/lax_der_parsing.c +++ b/src/secp256k1/contrib/lax_der_parsing.c @@ -32,7 +32,7 @@ int ecdsa_signature_parse_der_lax(const secp256k1_context* ctx, secp256k1_ecdsa_ lenbyte = input[pos++]; if (lenbyte & 0x80) { lenbyte -= 0x80; - if (pos + lenbyte > inputlen) { + if (lenbyte > inputlen - pos) { return 0; } pos += lenbyte; @@ -51,7 +51,7 @@ int ecdsa_signature_parse_der_lax(const secp256k1_context* ctx, secp256k1_ecdsa_ lenbyte = input[pos++]; if (lenbyte & 0x80) { lenbyte -= 0x80; - if (pos + lenbyte > inputlen) { + if (lenbyte > inputlen - pos) { return 0; } while (lenbyte > 0 && input[pos] == 0) { @@ -89,7 +89,7 @@ int ecdsa_signature_parse_der_lax(const secp256k1_context* ctx, secp256k1_ecdsa_ lenbyte = input[pos++]; if (lenbyte & 0x80) { lenbyte -= 0x80; - if (pos + lenbyte > inputlen) { + if (lenbyte > inputlen - pos) { return 0; } while (lenbyte > 0 && input[pos] == 0) { |