From c75a8d0aaddef555146b8e14af59916d10a95af0 Mon Sep 17 00:00:00 2001 From: Mike Beaton Date: Sun, 9 Nov 2025 18:34:14 +0000 Subject: [PATCH] CryptoPkg: Fix non-idiomatic endless loop This was found building ArmVirtQemu using CLANGDWARF with unused-but-set-variable warning enabled. Fixes: https://github.com/tianocore/edk2/commit/40fa5cf2995e9de6c9853945428f407f208be1e1 Signed-off-by: Mike Beaton --- CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptX509.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptX509.c b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptX509.c index 018bcb739f..e1e33145ed 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptX509.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptX509.c @@ -128,7 +128,6 @@ X509ConstructCertificateStackV ( { UINT8 *Cert; UINTN CertSize; - INT32 Index; INT32 Ret; mbedtls_x509_crt *Crt; @@ -148,7 +147,7 @@ X509ConstructCertificateStackV ( *X509Stack = (UINT8 *)Crt; } - for (Index = 0; ; Index++) { + while (TRUE) { // // If Cert is NULL, then it is the end of the list. //