From e227b2ad7d04ab358c62d4e5ce6772005147dd49 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 11 Sep 2024 14:03:29 -0500 Subject: [PATCH] wolfcrypt/src/sp_int.c: fix bugprone-too-small-loop-variable in _sp_mul(). --- wolfcrypt/src/sp_int.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 420f7e5a8..bb73fea2a 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -9390,7 +9390,7 @@ static int _sp_mul(const sp_int* a, const sp_int* b, sp_int* r) #ifdef SP_WORD_OVERFLOW o = 0; #endif - for (k = 1; k <= (a->used - 1) + (b->used - 1); k++) { + for (k = 1; (int)k <= ((int)a->used - 1) + ((int)b->used - 1); k++) { i = k - (sp_size_t)(b->used - 1); i &= (sp_size_t)(((unsigned int)i >> (sizeof(i) * 8 - 1)) - 1U); j = (int)(k - i);