Skip to content

Commit 29e0af3

Browse files
committed
initialize values used by unsigned bin
1 parent bdc1f89 commit 29e0af3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

wolfcrypt/src/sp_int.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18066,6 +18066,8 @@ int sp_read_unsigned_bin(sp_int* a, const byte* in, word32 inSz)
1806618066
/* Load full digits at a time from in. */
1806718067
int i;
1806818068
int j = 0;
18069+
int k;
18070+
(void) k;
1806918071

1807018072
a->used = (sp_size_t)((inSz + SP_WORD_SIZEOF - 1) / SP_WORD_SIZEOF);
1807118073

@@ -18077,6 +18079,9 @@ int sp_read_unsigned_bin(sp_int* a, const byte* in, word32 inSz)
1807718079
a->dp[j++] = *(sp_int_digit*)(in + i - (SP_WORD_SIZEOF - 1));
1807818080
}
1807918081
#else
18082+
for (k = 0; k < (int)a->used; k++) {
18083+
a->dp[k] = 0;
18084+
}
1808018085
/* Construct digit from required number of bytes. */
1808118086
for (i = (int)(inSz-1); i >= SP_WORD_SIZEOF - 1; i -= SP_WORD_SIZEOF) {
1808218087
a->dp[j] = ((sp_int_digit)in[i - 0] << 0)

0 commit comments

Comments
 (0)