Merge pull request #3504 from SparkiDev/fp_div_oob_read
TFM div: fix initial value of size in q so clamping doesn't OOB read
This commit is contained in:
commit
3808865f57
@ -679,7 +679,8 @@ int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
|
||||
#endif
|
||||
|
||||
fp_init(q);
|
||||
q->used = a->used + 2;
|
||||
/* qb + d = a, and b is an integer > 0, therefore q <= a */
|
||||
q->used = a->used;
|
||||
|
||||
fp_init(t1);
|
||||
fp_init(t2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user