From 960ba5f9c60c3fd454ad4160ce9131eb77d61d7e Mon Sep 17 00:00:00 2001 From: John Moffett Date: Mon, 1 Sep 2025 09:18:48 -0400 Subject: [PATCH] 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. --- src/hash_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hash_impl.h b/src/hash_impl.h index 956e0ea4..1065acd6 100644 --- a/src/hash_impl.h +++ b/src/hash_impl.h @@ -265,7 +265,7 @@ static void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256 while (outlen > 0) { secp256k1_hmac_sha256 hmac; - int now = outlen; + size_t now = outlen; secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32); secp256k1_hmac_sha256_write(&hmac, rng->v, 32); secp256k1_hmac_sha256_finalize(&hmac, rng->v);