diff --git a/src/api/accounts.c b/src/api/accounts.c index 5fcf74ac..a972de73 100644 --- a/src/api/accounts.c +++ b/src/api/accounts.c @@ -88,7 +88,7 @@ static struct agent_response _getAgentAccountInfosResponse(int type) { case AGENT_RESPONSE_TYPE_ACCOUNTINFO: request = getAccountInfoRequest(); break; - default: return (struct agent_response){}; + default: return (struct agent_response){0}; } char* response = communicate(LOCAL_COMM, request); struct agent_response ret = parseForAgentAccountInfosResponse(response, type); diff --git a/src/oidc-agent/oidc/flows/openid_config.c b/src/oidc-agent/oidc/flows/openid_config.c index 80b5f64c..4caea926 100644 --- a/src/oidc-agent/oidc/flows/openid_config.c +++ b/src/oidc-agent/oidc/flows/openid_config.c @@ -66,7 +66,7 @@ oidc_error_t obtainIssuerConfig(struct oidc_account* account) { char* getScopesSupportedFor(const char* issuer_url, const char* config_endpoint, const char* cert_path) { - struct oidc_account account = {}; + struct oidc_account account = {0}; account_setIssuerUrl(&account, oidc_strcopy(issuer_url)); account_setConfigEndpoint(&account, oidc_strcopy(config_endpoint)); if (strValid(cert_path)) { @@ -84,7 +84,7 @@ char* getScopesSupportedFor(const char* issuer_url, const char* config_endpoint, char* getProvidersSupportedByMytoken(const char* issuer_url, const char* config_endpoint, const char* cert_path) { - struct oidc_account account = {}; + struct oidc_account account = {0}; account_setIssuerUrl(&account, oidc_strcopy(issuer_url)); account_setConfigEndpoint(&account, oidc_strcopy(config_endpoint)); if (strValid(cert_path)) { diff --git a/src/utils/crypt/ipcCryptUtils.c b/src/utils/crypt/ipcCryptUtils.c index eeca51dc..2724fb77 100644 --- a/src/utils/crypt/ipcCryptUtils.c +++ b/src/utils/crypt/ipcCryptUtils.c @@ -36,11 +36,10 @@ char* decryptForIpc(const char* msg, const unsigned char* key) { oidc_errno = OIDC_ECRYPMIPC; return NULL; } - struct encryptionInfo crypt = {}; - crypt.nonce_base64 = nonce_base64; - crypt.encrypted_base64 = encrypted_base64; - crypt.cryptParameter = newCryptParameters(); - unsigned char* decryptedMsg = + struct encryptionInfo crypt = {.nonce_base64 = nonce_base64, + .encrypted_base64 = encrypted_base64, + .cryptParameter = newCryptParameters()}; + unsigned char* decryptedMsg = crypt_decryptWithKey(&crypt, msg_len + crypt.cryptParameter.mac_len, key); secFree(msg_tmp); return (char*)decryptedMsg; diff --git a/src/utils/uriUtils.c b/src/utils/uriUtils.c index 76ceda26..034e2c6b 100644 --- a/src/utils/uriUtils.c +++ b/src/utils/uriUtils.c @@ -64,17 +64,17 @@ char* getTopHost(const char* uri) { oidc_setArgNullFuncError(__func__); return NULL; } - char* tmp = oidc_strcopy(uri); - char* b = strstr(tmp, "://") + 3; - char* e = strchr(b, '/'); - *e = '\0'; - e = strrchr(b, '.'); - *e = '\0'; - char* t = strrchr(b, '.'); - if (t!=NULL) { - b=t+1; + char* tmp = oidc_strcopy(uri); + char* b = strstr(tmp, "://") + 3; + char* e = strchr(b, '/'); + *e = '\0'; + e = strrchr(b, '.'); + *e = '\0'; + char* t = strrchr(b, '.'); + if (t != NULL) { + b = t + 1; } - char* extracted = oidc_strcopy(b ); + char* extracted = oidc_strcopy(b); secFree(tmp); return extracted; } @@ -82,7 +82,7 @@ char* getTopHost(const char* uri) { struct codeState codeStateFromURI(const char* uri) { if (uri == NULL) { oidc_setArgNullFuncError(__func__); - return (struct codeState){}; + return (struct codeState){0}; } char* state = extractParameterValueFromUri(uri, "state"); char* code = extractParameterValueFromUri(uri, "code");