Skip to content

Commit 960ba5f

Browse files
committed
Use size_t instead of int for RFC6979 outlen copy
If outlen is > INT_MAX, could trigger segfault or hang after copy int now = outlen.
1 parent f36afb8 commit 960ba5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hash_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256
265265

266266
while (outlen > 0) {
267267
secp256k1_hmac_sha256 hmac;
268-
int now = outlen;
268+
size_t now = outlen;
269269
secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
270270
secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
271271
secp256k1_hmac_sha256_finalize(&hmac, rng->v);

0 commit comments

Comments
 (0)