Skip to content

Commit 8f810c2

Browse files
clear q with integer.c and mp_div_3 in error case
1 parent 73e4259 commit 8f810c2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

wolfcrypt/src/integer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,8 +3278,10 @@ int mp_div_3 (mp_int * a, mp_int *c, mp_digit * d)
32783278
q.sign = a->sign;
32793279
w = 0;
32803280

3281-
if (a->used == 0)
3281+
if (a->used == 0) {
3282+
mp_clear(&q);
32823283
return MP_VAL;
3284+
}
32833285

32843286
for (ix = a->used - 1; ix >= 0; ix--) {
32853287
w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]);

0 commit comments

Comments
 (0)