forked from wolfSSL/wolfssl
Merge pull request #2668 from ejohnstown/maintenance-scanbuild
Fixed a couple initialization issues scan-build indicated
This commit is contained in:
@ -24457,6 +24457,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
ERROR_OUT(MEMORY_E, exit_sske);
|
ERROR_OUT(MEMORY_E, exit_sske);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args->output == NULL) {
|
||||||
|
ERROR_OUT(BUFFER_ERROR, exit_sske);
|
||||||
|
}
|
||||||
|
|
||||||
XMEMCPY(args->input, args->output + RECORD_HEADER_SZ,
|
XMEMCPY(args->input, args->output + RECORD_HEADER_SZ,
|
||||||
args->inputSz);
|
args->inputSz);
|
||||||
ret = BuildMessage(ssl, args->output, args->sendSz,
|
ret = BuildMessage(ssl, args->output, args->sendSz,
|
||||||
|
@ -5670,6 +5670,7 @@ int AES_GCM_encrypt_C(Aes* aes, byte* out, const byte* in, word32 sz,
|
|||||||
#endif
|
#endif
|
||||||
ctr = counter;
|
ctr = counter;
|
||||||
XMEMSET(initialCounter, 0, AES_BLOCK_SIZE);
|
XMEMSET(initialCounter, 0, AES_BLOCK_SIZE);
|
||||||
|
XMEMSET(scratch, 0, AES_BLOCK_SIZE);
|
||||||
if (ivSz == GCM_NONCE_MID_SZ) {
|
if (ivSz == GCM_NONCE_MID_SZ) {
|
||||||
XMEMCPY(initialCounter, iv, ivSz);
|
XMEMCPY(initialCounter, iv, ivSz);
|
||||||
initialCounter[AES_BLOCK_SIZE - 1] = 1;
|
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)
|
authTagSz > AES_BLOCK_SIZE)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
|
XMEMSET(A, 0, sizeof(A));
|
||||||
XMEMCPY(B+1, nonce, nonceSz);
|
XMEMCPY(B+1, nonce, nonceSz);
|
||||||
lenSz = AES_BLOCK_SIZE - 1 - (byte)nonceSz;
|
lenSz = AES_BLOCK_SIZE - 1 - (byte)nonceSz;
|
||||||
B[0] = (authInSz > 0 ? 64 : 0)
|
B[0] = (authInSz > 0 ? 64 : 0)
|
||||||
|
Reference in New Issue
Block a user