fix clang static analyzer warnings/errors - see #217

This commit is contained in:
Karel Miko
2017-05-11 20:37:06 +02:00
parent 08cc78007b
commit 43e46a2efc
7 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -899,7 +899,7 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri
{
int N, R, i, pos, r;
ulong32 kappa[MAX_N];
ulong32 inter[MAX_N];
ulong32 inter[MAX_N] = { 0 }; /* initialize as all zeroes */
ulong32 v, K0, K1, K2, K3;
LTC_ARGCHK(key != NULL);
+1 -1
View File
@@ -144,7 +144,7 @@ int ccm_memory(int cipher,
}
/* initialize buffer for pt */
if (direction == CCM_DECRYPT) {
if (direction == CCM_DECRYPT && ptlen > 0) {
pt_work = XMALLOC(ptlen);
if (pt_work == NULL) {
goto error;
+1 -1
View File
@@ -49,7 +49,7 @@ static int char_to_int(unsigned char x)
int der_decode_utctime(const unsigned char *in, unsigned long *inlen,
ltc_utctime *out)
{
unsigned char buf[32];
unsigned char buf[32] = { 0 }; /* initialize as all zeroes */
unsigned long x;
int y;