@@ -1384,9 +1384,8 @@ int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count, int complete,
13841384 int len;
13851385 /* Current index into buffer. */
13861386 word32 idx = *inOutIdx;
1387- /* Initialize the end index at each depth to be the length. */
1388- word32 endIdx[GET_ASN_MAX_DEPTH] = { length, length, length, length, length,
1389- length, length };
1387+ /* Declare the end index array. */
1388+ word32 endIdx[GET_ASN_MAX_DEPTH];
13901389 /* Set choices to -1 to indicate they haven't been seen or found. */
13911390 signed char choiceMet[GET_ASN_MAX_CHOICES] = { -1, -1 };
13921391 /* Not matching a choice right now. */
@@ -1402,6 +1401,11 @@ int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count, int complete,
14021401 WOLFSSL_ENTER("GetASN_Items");
14031402#endif
14041403
1404+ /* Set the end index at each depth to be the length. */
1405+ for (i=0; i<GET_ASN_MAX_DEPTH; i++) {
1406+ endIdx[i] = length;
1407+ }
1408+
14051409 /* Start depth at first items depth. */
14061410 minDepth = depth = asn[0].depth;
14071411 /* Check every ASN.1 item. */
@@ -3014,7 +3018,7 @@ int GetMyVersion(const byte* input, word32* inOutIdx,
30143018#else
30153019 ASNGetData dataASN[intASN_Length];
30163020 int ret;
3017- byte num;
3021+ byte num = 0 ;
30183022
30193023 /* Clear dynamic data and set the version number variable. */
30203024 XMEMSET(dataASN, 0, sizeof(dataASN));
@@ -3081,7 +3085,7 @@ int GetShortInt(const byte* input, word32* inOutIdx, int* number, word32 maxIdx)
30813085#else
30823086 ASNGetData dataASN[intASN_Length];
30833087 int ret;
3084- word32 num;
3088+ word32 num = 0 ;
30853089
30863090 /* Clear dynamic data and set the 32-bit number variable. */
30873091 XMEMSET(dataASN, 0, sizeof(dataASN));
@@ -6827,7 +6831,7 @@ int ToTraditionalInline_ex(const byte* input, word32* inOutIdx, word32 sz,
68276831 DECL_ASNGETDATA(dataASN, pkcs8KeyASN_Length);
68286832 int ret = 0;
68296833 word32 oid = 9;
6830- byte version;
6834+ byte version = 0 ;
68316835 word32 idx;
68326836
68336837 /* Check validity of parameters. */
@@ -8745,7 +8749,7 @@ int DecryptContent(byte* input, word32 sz, const char* password, int passwordSz)
87458749 int version;
87468750 word32 idx = 0;
87478751 word32 pIdx = 0;
8748- word32 iterations;
8752+ word32 iterations = 0 ;
87498753 word32 keySz = 0;
87508754 word32 saltSz = 0;
87518755 word32 shaOid = 0;
@@ -19652,7 +19656,7 @@ enum {
1965219656static int DecodeSubtreeGeneralName(const byte* input, word32 sz, byte tag,
1965319657 Base_entry** head, void* heap)
1965419658{
19655- Base_entry* entry;
19659+ Base_entry* entry = NULL ;
1965619660 word32 nameIdx = 0;
1965719661 word32 len = sz;
1965819662 int strLen;
@@ -33178,7 +33182,7 @@ int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx, ecc_key* key,
3317833182 return ret;
3317933183#else
3318033184 DECL_ASNGETDATA(dataASN, eccKeyASN_Length);
33181- byte version;
33185+ byte version = 0 ;
3318233186 int ret = 0;
3318333187 int curve_id = ECC_CURVE_DEF;
3318433188#if defined(HAVE_PKCS8) || defined(HAVE_PKCS12) || defined(SM2)
@@ -36210,7 +36214,7 @@ int OcspResponseDecode(OcspResponse* resp, void* cm, void* heap, int noVerify)
3621036214 int ret = 0;
3621136215 word32 idx = 0, size = resp->maxIdx;
3621236216 byte* source = resp->source;
36213- byte status;
36217+ byte status = 0 ;
3621436218 byte* basic;
3621536219 word32 basicSz;
3621636220
0 commit comments