From f0f6497526ce02ef31c948780247964b139d3e23 Mon Sep 17 00:00:00 2001 From: toddouska Date: Sun, 2 Mar 2014 11:11:39 -0800 Subject: [PATCH] fix -Wconditional-uninitialized --- ctaocrypt/benchmark/benchmark.c | 2 +- src/internal.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ctaocrypt/benchmark/benchmark.c b/ctaocrypt/benchmark/benchmark.c index e495521ca..8fa17e725 100644 --- a/ctaocrypt/benchmark/benchmark.c +++ b/ctaocrypt/benchmark/benchmark.c @@ -800,7 +800,7 @@ void bench_dh(void) int i, ret; byte tmp[1024]; size_t bytes; - word32 idx = 0, pubSz, privSz, pubSz2, privSz2, agreeSz; + word32 idx = 0, pubSz, privSz = 0, pubSz2, privSz2, agreeSz; byte pub[256]; /* for 2048 bit */ byte priv[256]; /* for 2048 bit */ diff --git a/src/internal.c b/src/internal.c index d6752f823..29e2724e0 100644 --- a/src/internal.c +++ b/src/internal.c @@ -10336,8 +10336,8 @@ static void PickHashSigAlgo(CYASSL* ssl, /* RSA */ #ifndef NO_RSA if (ssl->peerRsaKeyPresent != 0) { - byte* out; - int outLen; + byte* out = NULL; + int outLen = 0; byte doUserRsa = 0; #ifdef HAVE_PK_CALLBACKS @@ -10388,12 +10388,12 @@ static void PickHashSigAlgo(CYASSL* ssl, sigSz = EncodeSignature(encodedSig, digest, digestSz, typeH); - if (outLen == (int)sigSz && XMEMCMP(out, encodedSig, + if (outLen == (int)sigSz && out && XMEMCMP(out, encodedSig, min(sigSz, MAX_ENCODED_SIG_SZ)) == 0) ret = 0; /* verified */ } else { - if (outLen == FINISHED_SZ && XMEMCMP(out, + if (outLen == FINISHED_SZ && out && XMEMCMP(out, &ssl->certHashes, FINISHED_SZ) == 0) ret = 0; /* verified */ }