forked from wolfSSL/wolfssl
fix scanbuild issues, internal.c and tfm.c
This commit is contained in:
@ -6022,6 +6022,9 @@ static void AddHandShakeHeader(byte* output, word32 length,
|
|||||||
|
|
||||||
/* handshake header */
|
/* handshake header */
|
||||||
hs = (HandShakeHeader*)output;
|
hs = (HandShakeHeader*)output;
|
||||||
|
if (hs == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
hs->type = type;
|
hs->type = type;
|
||||||
c32to24(length, hs->length); /* type and length same for each */
|
c32to24(length, hs->length); /* type and length same for each */
|
||||||
#ifdef WOLFSSL_DTLS
|
#ifdef WOLFSSL_DTLS
|
||||||
@ -14098,6 +14101,8 @@ int SendAlert(WOLFSSL* ssl, int severity, int type)
|
|||||||
/* get output buffer */
|
/* get output buffer */
|
||||||
output = ssl->buffers.outputBuffer.buffer +
|
output = ssl->buffers.outputBuffer.buffer +
|
||||||
ssl->buffers.outputBuffer.length;
|
ssl->buffers.outputBuffer.length;
|
||||||
|
if (output == NULL)
|
||||||
|
return BUFFER_E;
|
||||||
|
|
||||||
input[0] = (byte)severity;
|
input[0] = (byte)severity;
|
||||||
input[1] = (byte)type;
|
input[1] = (byte)type;
|
||||||
|
@ -2915,9 +2915,9 @@ int fp_isprime_ex(fp_int *a, int t)
|
|||||||
|
|
||||||
/* do trial division */
|
/* do trial division */
|
||||||
for (r = 0; r < FP_PRIME_SIZE; r++) {
|
for (r = 0; r < FP_PRIME_SIZE; r++) {
|
||||||
fp_mod_d(a, primes[r], &d);
|
res = fp_mod_d(a, primes[r], &d);
|
||||||
if (d == 0) {
|
if (res != MP_OKAY || d == 0) {
|
||||||
return FP_NO;
|
return FP_NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user