Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix llvm error: variable 'default_iv_length' and other may be used uninitialized #7210

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/psa_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -3997,7 +3997,7 @@ psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation,
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
uint8_t local_iv[PSA_CIPHER_IV_MAX_SIZE];
size_t default_iv_length;
size_t default_iv_length = 0;

if (operation->id == 0) {
status = PSA_ERROR_BAD_STATE;
Expand Down Expand Up @@ -4604,7 +4604,7 @@ psa_status_t psa_aead_generate_nonce(psa_aead_operation_t *operation,
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
uint8_t local_nonce[PSA_AEAD_NONCE_MAX_SIZE];
size_t required_nonce_size;
size_t required_nonce_size = 0;

*nonce_length = 0;

Expand Down
2 changes: 1 addition & 1 deletion library/ssl_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ int mbedtls_ssl_cache_set(void *data,
mbedtls_ssl_cache_context *cache = (mbedtls_ssl_cache_context *) data;
mbedtls_ssl_cache_entry *cur;

size_t session_serialized_len;
size_t session_serialized_len = 0;
unsigned char *session_serialized = NULL;

#if defined(MBEDTLS_THREADING_C)
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/test_suite_psa_crypto.function
Original file line number Diff line number Diff line change
Expand Up @@ -9672,7 +9672,7 @@ void persistent_key_load_key_from_storage(data_t *data,
unsigned char *first_export = NULL;
unsigned char *second_export = NULL;
size_t export_size = PSA_EXPORT_KEY_OUTPUT_SIZE(type, bits);
size_t first_exported_length;
size_t first_exported_length = 0;
size_t second_exported_length;

if (usage_flags & PSA_KEY_USAGE_EXPORT) {
Expand Down