For cppcheck: Explicitly initialize some variables

This commit is contained in:
Lealem Amedie
2024-02-05 15:09:05 -07:00
parent 63f7298be2
commit d36bd47a27

View File

@ -3018,7 +3018,7 @@ int GetMyVersion(const byte* input, word32* inOutIdx,
#else
ASNGetData dataASN[intASN_Length];
int ret;
byte num;
byte num = 0;
/* Clear dynamic data and set the version number variable. */
XMEMSET(dataASN, 0, sizeof(dataASN));
@ -3085,7 +3085,7 @@ int GetShortInt(const byte* input, word32* inOutIdx, int* number, word32 maxIdx)
#else
ASNGetData dataASN[intASN_Length];
int ret;
word32 num;
word32 num = 0;
/* Clear dynamic data and set the 32-bit number variable. */
XMEMSET(dataASN, 0, sizeof(dataASN));
@ -6767,7 +6767,7 @@ int ToTraditionalInline_ex(const byte* input, word32* inOutIdx, word32 sz,
DECL_ASNGETDATA(dataASN, pkcs8KeyASN_Length);
int ret = 0;
word32 oid = 9;
byte version;
byte version = 0;
word32 idx;
/* Check validity of parameters. */
@ -8685,7 +8685,7 @@ exit_dc:
int version;
word32 idx = 0;
word32 pIdx = 0;
word32 iterations;
word32 iterations = 0;
word32 keySz = 0;
word32 saltSz = 0;
word32 shaOid = 0;
@ -33081,7 +33081,7 @@ int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key,
return ret;
#else
DECL_ASNGETDATA(dataASN, eccKeyASN_Length);
byte version;
byte version = 0;
int ret = 0;
int curve_id = ECC_CURVE_DEF;
#if defined(HAVE_PKCS8) || defined(HAVE_PKCS12) || defined(SM2)
@ -36113,7 +36113,7 @@ int OcspResponseDecode(OcspResponse* resp, void* cm, void* heap, int noVerify)
int ret = 0;
word32 idx = 0, size = resp->maxIdx;
byte* source = resp->source;
byte status;
byte status = 0;
byte* basic;
word32 basicSz;