From 49740c5543b288e43acb3870482082e323e15b69 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 24 Jun 2022 15:21:20 -0600 Subject: [PATCH] initialize variables --- wolfcrypt/src/asn.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index f95d5ea0c..79d106ada 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -14668,9 +14668,9 @@ static int DecodeSEP(ASNGetData* dataASN, DecodedCert* cert) static int DecodeOtherHelper(ASNGetData* dataASN, DecodedCert* cert, int oid) { DNS_entry* entry = NULL; - int ret; - word32 bufLen; - const char* buf; + int ret = 0; + word32 bufLen = 0; + const char* buf = NULL; switch (oid) { case FASCN_OID: @@ -14681,12 +14681,16 @@ static int DecodeOtherHelper(ASNGetData* dataASN, DecodedCert* cert, int oid) bufLen = dataASN[OTHERNAMEASN_IDX_UPN].data.ref.length; buf = (const char*)dataASN[OTHERNAMEASN_IDX_UPN].data.ref.data; break; + default: + ret = ASN_UNKNOWN_OID_E; } - ret = SetDNSEntry(cert, buf, bufLen, ASN_OTHER_TYPE, &entry); if (ret == 0) { - entry->oidSum = oid; - AddDNSEntryToList(&cert->altNames, entry); + ret = SetDNSEntry(cert, buf, bufLen, ASN_OTHER_TYPE, &entry); + if (ret == 0) { + entry->oidSum = oid; + AddDNSEntryToList(&cert->altNames, entry); + } } return ret; }