From 13c4f6299d651a0915353a0423d12a0ea28c7bc7 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Wed, 23 Oct 2024 18:44:05 -0700 Subject: [PATCH] CryptoPkg/BaseCryptLib: Fix serial number read overrun Signed-off-by: Michael D Kinney --- CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c index 628e71439e3e..0239fee4e12d 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c @@ -1056,7 +1056,7 @@ X509GetSerialNumber ( } if (SerialNumber != NULL) { - CopyMem (SerialNumber, Asn1Integer->data, *SerialNumberSize); + CopyMem (SerialNumber, Asn1Integer->data, (UINTN)Asn1Integer->length); Status = TRUE; }