From 41eef2ef71cad027e62e694eaab5095727690aa4 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Fri, 4 Jul 2025 09:01:07 +1000 Subject: [PATCH] CodeQL: o is larger type and could cause issues Make 'o' sp_size_t as the callers are passing 0 or explicit cast to sp_size_t --- wolfcrypt/src/sp_int.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index e03d2ea39..1703bacf9 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -7600,7 +7600,7 @@ static void _sp_add_off(const sp_int* a, const sp_int* b, sp_int* r, int o) * @param [in] o Number of digits to offset b. */ static void _sp_sub_off(const sp_int* a, const sp_int* b, sp_int* r, - unsigned int o) + sp_size_t o) { sp_size_t i = 0; sp_size_t j; @@ -7618,7 +7618,7 @@ static void _sp_sub_off(const sp_int* a, const sp_int* b, sp_int* r, } } else { - i = (sp_size_t)o; + i = o; } /* Index to add at is the offset now. */