Skip to content

Commit 920a0e5

Browse files
committedOct 17, 2021
Merge #952: Avoid computing out-of-bounds pointer.
9be7b0f Avoid computing out-of-bounds pointer. (Tim Ruffing) Pull request description: This is a pedantic case of UB. Spotted in #879. ACKs for top commit: elichai: ACK 9be7b0f practicalswift: cr ACK 9be7b0f sipa: ACK 9be7b0f Tree-SHA512: a9d028c4cdb37ad0d5fcf0d2f678eef732a653d37155a69a20272c6b283c28e083172485d7a37dc4a7c6100b22a6f5b6a92e729239031be228cc511842ee35e8
2 parents f34b5ca + 9be7b0f commit 920a0e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/ecdsa_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int secp256k1_der_parse_integer(secp256k1_scalar *r, const unsigned char
112112
if (secp256k1_der_read_len(&rlen, sig, sigend) == 0) {
113113
return 0;
114114
}
115-
if (rlen == 0 || *sig + rlen > sigend) {
115+
if (rlen == 0 || rlen > (size_t)(sigend - *sig)) {
116116
/* Exceeds bounds or not at least length 1 (X.690-0207 8.3.1). */
117117
return 0;
118118
}

0 commit comments

Comments
 (0)
Please sign in to comment.