forked from wolfSSL/wolfssl
Merge pull request #765 from dgarske/scanbuild_fixes
Fixes for scan-build warnings
This commit is contained in:
@ -16137,6 +16137,7 @@ WOLFSSL_DH* wolfSSL_DH_new(void)
|
|||||||
if (wc_InitDhKey(key) != 0) {
|
if (wc_InitDhKey(key) != 0) {
|
||||||
WOLFSSL_MSG("wolfSSL_DH_new InitDhKey failure");
|
WOLFSSL_MSG("wolfSSL_DH_new InitDhKey failure");
|
||||||
XFREE(key, NULL, DYNAMIC_TYPE_DH);
|
XFREE(key, NULL, DYNAMIC_TYPE_DH);
|
||||||
|
XFREE(external, NULL, DYNAMIC_TYPE_DH);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
external->internal = key;
|
external->internal = key;
|
||||||
|
@ -354,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1638,6 +1638,11 @@ int s_mp_sub (mp_int * a, mp_int * b, mp_int * c)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* sanity check on destination */
|
||||||
|
if (c->dp == NULL)
|
||||||
|
return MP_VAL;
|
||||||
|
|
||||||
olduse = c->used;
|
olduse = c->used;
|
||||||
c->used = max_a;
|
c->used = max_a;
|
||||||
|
|
||||||
@ -3767,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;
|
||||||
|
|
||||||
@ -3840,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;
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ int wolfCrypt_Init(void)
|
|||||||
WOLFSSL_MSG(ippGetStatusString(ret));
|
WOLFSSL_MSG(ippGetStatusString(ret));
|
||||||
WOLFSSL_MSG("Using default fast IPP library");
|
WOLFSSL_MSG("Using default fast IPP library");
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
(void)ret; /* suppress not read warning */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user