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

mbedtls-2.28: Fix llvm error: variable 'default_iv_length' may be used uninitialized #7211

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

sergio-nsk
Copy link
Contributor

@sergio-nsk sergio-nsk commented Mar 6, 2023

Description

Backport of #7210

mbedtls/library/psa_crypto.c:3428:30: error: variable 'default_iv_length' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
        memcpy(iv, local_iv, default_iv_length);
                             ^~~~~~~~~~~~~~~~~

The warning is false positive, but treated as error and prevents compiling on Windows with LLVM Clang.

Gatekeeper checklist

  • changelog not required
  • backport done
  • tests not required

@sergio-nsk sergio-nsk changed the title Fix llvm error: variable 'default_iv_length' may be used uninitialized mbedtls-2.28: Fix llvm error: variable 'default_iv_length' may be used uninitialized Mar 6, 2023
@bensze01 bensze01 self-assigned this Mar 8, 2023
@davidhorstmann-arm davidhorstmann-arm added the historical-reviewing Currently reviewing (for legacy PR/issues) label Jun 2, 2023
@sergio-nsk
Copy link
Contributor Author

sergio-nsk commented Sep 11, 2023

What is the issue with accepting this PR with the tiny change?
We would like to use mbedtls from the vendor upstream in git submodules, and w/o this change, we have to use a clone with patches.
Compilers are not smart enough to deduce status == PSA_SUCCESS is false and they raise the warning: variable 'default_iv_length' may be uninitialized when used here: memcpy(iv, local_iv, default_iv_length).

Copy link
Contributor

@tom-cosgrove-arm tom-cosgrove-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@davidhorstmann-arm davidhorstmann-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidhorstmann-arm davidhorstmann-arm added approved Design and code approved - may be waiting for CI or backports size-s Estimated task size: small (~2d) and removed historical-reviewing Currently reviewing (for legacy PR/issues) labels Sep 12, 2023
@gilles-peskine-arm gilles-peskine-arm merged commit 5161645 into Mbed-TLS:mbedtls-2.28 Sep 13, 2023
@sergio-nsk sergio-nsk deleted the patch-3 branch August 14, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports size-s Estimated task size: small (~2d)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants