summaryrefslogtreecommitdiffstats
path: root/CryptoPkg
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2024-10-23 18:44:05 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-11-08 16:28:50 +0000
commitd5600f4f5a9116c2fc0dd0daf3304477603dbf3f (patch)
treef0dc447c3803ba57d491c29cd5db099ecf60ebab /CryptoPkg
parent12e1b1f8ef6ec14ff518518c9f5794e127308aa2 (diff)
downloadedk2-d5600f4f5a9116c2fc0dd0daf3304477603dbf3f.tar.gz
edk2-d5600f4f5a9116c2fc0dd0daf3304477603dbf3f.tar.bz2
edk2-d5600f4f5a9116c2fc0dd0daf3304477603dbf3f.zip
CryptoPkg/BaseCryptLib: Fix serial number read overrun
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'CryptoPkg')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c
index 628e71439e..0239fee4e1 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;
}