diff --git a/lib/zip_crypto_openssl.c b/lib/zip_crypto_openssl.c index 3b45fe9e4..f7b910a60 100644 --- a/lib/zip_crypto_openssl.c +++ b/lib/zip_crypto_openssl.c @@ -126,7 +126,7 @@ _zip_crypto_aes_free(_zip_crypto_aes_t *aes) { bool _zip_crypto_aes_encrypt_block(_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out) { - int len; + int len = 0; if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1 || len != ZIP_CRYPTO_AES_BLOCK_LENGTH) { return false; @@ -215,10 +215,10 @@ _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac) { bool _zip_crypto_hmac_output(_zip_crypto_hmac_t *hmac, zip_uint8_t *data) { #ifdef USE_OPENSSL_3_API - size_t length; + size_t length = 0; return EVP_MAC_final(hmac->ctx, data, &length, ZIP_CRYPTO_SHA1_LENGTH) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; #else - unsigned int length; + unsigned int length = 0; return HMAC_Final(hmac, data, &length) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; #endif }