Skip to content

Commit 41eef2e

Browse files
committed
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
1 parent d8caa84 commit 41eef2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/sp_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7600,7 +7600,7 @@ static void _sp_add_off(const sp_int* a, const sp_int* b, sp_int* r, int o)
76007600
* @param [in] o Number of digits to offset b.
76017601
*/
76027602
static void _sp_sub_off(const sp_int* a, const sp_int* b, sp_int* r,
7603-
unsigned int o)
7603+
sp_size_t o)
76047604
{
76057605
sp_size_t i = 0;
76067606
sp_size_t j;
@@ -7618,7 +7618,7 @@ static void _sp_sub_off(const sp_int* a, const sp_int* b, sp_int* r,
76187618
}
76197619
}
76207620
else {
7621-
i = (sp_size_t)o;
7621+
i = o;
76227622
}
76237623
/* Index to add at is the offset now. */
76247624

0 commit comments

Comments
 (0)