From 53bf8ed7cb2c9d78cd8bcb3ff8c4b49979082300 Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 10 Jun 2015 15:24:24 -0700 Subject: [PATCH] fix scan-build warnings --- examples/client/client.c | 4 +++- src/internal.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index 0546bb0f2..38ef59383 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -299,7 +299,9 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) break; case 'C' : - disableCRL = 1; + #ifdef HAVE_CRL + disableCRL = 1; + #endif break; case 'u' : diff --git a/src/internal.c b/src/internal.c index 6cca94b45..e837c41e3 100644 --- a/src/internal.c +++ b/src/internal.c @@ -6059,6 +6059,8 @@ static int TimingPadVerify(WOLFSSL* ssl, const byte* input, int padLen, int t, byte* dummy = sizeof(dmy) < MAX_PAD_SIZE ? (byte*) ssl : dmy; int ret = 0; + (void)dmy; + if ( (t + padLen + 1) > pLen) { WOLFSSL_MSG("Plain Len not long enough for pad/mac"); PadCheck(dummy, (byte)padLen, MAX_PAD_SIZE); @@ -6295,6 +6297,8 @@ static INLINE int VerifyMac(WOLFSSL* ssl, const byte* input, word32 msgSz, byte dmy[sizeof(WOLFSSL) >= MAX_PAD_SIZE ? 1 : MAX_PAD_SIZE] = {0}; byte* dummy = sizeof(dmy) < MAX_PAD_SIZE ? (byte*) ssl : dmy; + (void)dmy; + if (pad > (msgSz - digestSz - 1)) { WOLFSSL_MSG("Plain Len not long enough for pad/mac"); pad = 0; /* no bad read */