summaryrefslogtreecommitdiffstats
path: root/CryptoPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-08-29 19:44:18 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-08-31 02:46:51 +0000
commit90d861f63d0fe467cec9659703f02d3d32969dc3 (patch)
tree6a8c8eb18f2a674e3371568798c5100107fa76bd /CryptoPkg
parent468a36b22f0ac61b1f4def70ebbb98949def161d (diff)
downloadedk2-90d861f63d0fe467cec9659703f02d3d32969dc3.tar.gz
edk2-90d861f63d0fe467cec9659703f02d3d32969dc3.tar.bz2
edk2-90d861f63d0fe467cec9659703f02d3d32969dc3.zip
CryptoPkg/BaseCryptLibMbedTls: Fix uninitialized variable errors
Clang complains about a couple of variables potentially being uninitialized, and those complaints seem to be valid. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'CryptoPkg')
-rw-r--r--CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptPkcs7Sign.c1
-rw-r--r--CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptTs.c15
2 files changed, 8 insertions, 8 deletions
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptPkcs7Sign.c b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptPkcs7Sign.c
index e3283dad48..6caed97c94 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptPkcs7Sign.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptPkcs7Sign.c
@@ -486,6 +486,7 @@ Pkcs7Sign (
return FALSE;
}
+ Buffer = NULL;
BufferSize = 4096;
SignatureLen = MAX_SIGNATURE_SIZE;
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptTs.c b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptTs.c
index d3fa205f9c..d7a07836bb 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptTs.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Pk/CryptTs.c
@@ -118,12 +118,11 @@ ImageTimestampVerify (
OUT EFI_TIME *SigningTime
)
{
- BOOLEAN Status;
- UINT8 *Ptr;
- UINT8 *End;
- INT32 Len;
- UINTN ObjLen;
- UINT8 *TempPtr;
+ UINT8 *Ptr;
+ UINT8 *End;
+ INT32 Len;
+ UINTN ObjLen;
+ UINT8 *TempPtr;
//
// Initializations
@@ -374,8 +373,8 @@ ImageTimestampVerify (
//
if (SigningTime != NULL) {
SetMem (SigningTime, sizeof (EFI_TIME), 0);
- Status = ConvertAsn1TimeToEfiTime (Ptr, SigningTime);
+ return ConvertAsn1TimeToEfiTime (Ptr, SigningTime);
}
- return Status;
+ return TRUE;
}