mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Better fixes for suppressing scan-build warning with normal math enabled.
This commit is contained in:
@@ -336,10 +336,6 @@ int mp_copy (mp_int * a, mp_int * b)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sanity check on destination */
|
|
||||||
if (b->dp == NULL)
|
|
||||||
return MP_VAL;
|
|
||||||
|
|
||||||
/* zero b and copy the parameters over */
|
/* zero b and copy the parameters over */
|
||||||
{
|
{
|
||||||
mp_digit *tmpa, *tmpb;
|
mp_digit *tmpa, *tmpb;
|
||||||
@@ -358,7 +354,7 @@ int mp_copy (mp_int * a, mp_int * b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* clear high digits */
|
/* clear high digits */
|
||||||
for (; n < b->used; n++) {
|
for (; n < b->used && b->dp; n++) {
|
||||||
*tmpb++ = 0;
|
*tmpb++ = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3776,7 +3772,7 @@ int s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
|
|||||||
|
|
||||||
pa = a->used;
|
pa = a->used;
|
||||||
pb = b->used;
|
pb = b->used;
|
||||||
for (ix = 0; ix < pa; ix++) {
|
for (ix = 0; ix < pa && a->dp; ix++) {
|
||||||
/* clear the carry */
|
/* clear the carry */
|
||||||
u = 0;
|
u = 0;
|
||||||
|
|
||||||
@@ -3849,7 +3845,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
|
|||||||
/* number of output digits to produce */
|
/* number of output digits to produce */
|
||||||
pa = a->used + b->used;
|
pa = a->used + b->used;
|
||||||
_W = 0;
|
_W = 0;
|
||||||
for (ix = digs; ix < pa; ix++) {
|
for (ix = digs; ix < pa && a->dp; ix++) {
|
||||||
int tx, ty, iy;
|
int tx, ty, iy;
|
||||||
mp_digit *tmpx, *tmpy;
|
mp_digit *tmpx, *tmpy;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user