Fixed a couple initialization issues scan-build indicated.

pull/2668/head
John Safranek 2019-12-12 16:50:37 -08:00
parent 093a31ed49
commit e7af2d2ba9
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
2 changed files with 6 additions and 0 deletions

View File

@ -24457,6 +24457,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
ERROR_OUT(MEMORY_E, exit_sske);
}
if (args->output == NULL) {
ERROR_OUT(BUFFER_ERROR, exit_sske);
}
XMEMCPY(args->input, args->output + RECORD_HEADER_SZ,
args->inputSz);
ret = BuildMessage(ssl, args->output, args->sendSz,

View File

@ -5670,6 +5670,7 @@ int AES_GCM_encrypt_C(Aes* aes, byte* out, const byte* in, word32 sz,
#endif
ctr = counter;
XMEMSET(initialCounter, 0, AES_BLOCK_SIZE);
XMEMSET(scratch, 0, AES_BLOCK_SIZE);
if (ivSz == GCM_NONCE_MID_SZ) {
XMEMCPY(initialCounter, iv, ivSz);
initialCounter[AES_BLOCK_SIZE - 1] = 1;
@ -6681,6 +6682,7 @@ int wc_AesCcmEncrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
authTagSz > AES_BLOCK_SIZE)
return BAD_FUNC_ARG;
XMEMSET(A, 0, sizeof(A));
XMEMCPY(B+1, nonce, nonceSz);
lenSz = AES_BLOCK_SIZE - 1 - (byte)nonceSz;
B[0] = (authInSz > 0 ? 64 : 0)