Fixes from using cppcheck tool

Various fixes for uninitialized variable use.
sniffer.c: close file when seek fails
tls.c: fix QSH_GET_SIZE macro
wolfio.c: uIPGenerateCookie: use the parameter, _ctx, instead of self
referencing.
wolfssl_adds.c: check for equivalent to XBADFILE to indicate error.
SP: change right shift of signed value to unsigned
sp_int.h: define 128-bit types
types.h: change a XMALLOC define to not use (,,) - cppcheck doesn't like
it and is unnecessary.
This commit is contained in:
Sean Parkinson
2019-09-26 08:48:19 +10:00
parent ea68e146c7
commit 901ee627fc
26 changed files with 697 additions and 683 deletions

View File

@@ -209,7 +209,7 @@ RsaKey* GetRsaPrivateKey(const char* keyFile)
word32 idx = 0;
XFILE file = XFOPEN(keyFile, "rb");
if (file != XBADFILE)
if (file == XBADFILE)
{
free(key);
return 0;