Skip to content

Conversation

kraj
Copy link

@kraj kraj commented Aug 30, 2025

'mbedtls_x509_time now' is a local struct variable. passing an uninitialized local as a const *
argument is UB-risk, since the callee is not
allowed to write into it.

Clang-21 got stricter about const pointer arguments finds it and flags it.

zero-initializing ensures all fields are defined.

Description

Fix build with clang-21

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog provided | not required because:
  • development PR provided # | not required because:
  • TF-PSA-Crypto PR provided # | not required because:
  • framework PR provided Mbed-TLS/mbedtls-framework# | not required
  • 3.6 PR provided # | not required because:
  • tests provided | not required because:

Notes for the submitter

Please refer to the contributing guidelines, especially the
checklist for PR contributors.

Help make review efficient:

  • Multiple simple commits
    • please structure your PR into a series of small commits, each of which does one thing
  • Avoid force-push
    • please do not force-push to update your PR - just add new commit(s)
  • See our Guidelines for Contributors for more details about the review process.

'mbedtls_x509_time now' is a local struct variable.
passing an uninitialized local as a const *
argument is UB-risk, since the callee is not
allowed to write into it.

Clang-21 got stricter about const pointer arguments
finds it and flags it.

zero-initializing ensures all fields are defined.

Signed-off-by: Khem Raj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant