mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
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:
@@ -679,7 +679,8 @@ int fp_div(fp_int *a, fp_int *b, fp_int *c, fp_int *d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
fp_init(q);
|
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(t1);
|
||||||
fp_init(t2);
|
fp_init(t2);
|
||||||
|
Reference in New Issue
Block a user