From 7b4a99be8a39c12d3a7fc4b8db9f0eab4ac688d5 Mon Sep 17 00:00:00 2001 From: "Stewart, Chris (SW Architect) via groups.io" Date: Tue, 17 Aug 2021 20:47:44 +0800 Subject: [PATCH] CryptoPkg: BaseCryptLib fix incorrect param order REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3550 Function ConvertAsn1TimeToEfiTime initializes timestamp to zeroes with SetMem, but the actual parameters are out of order. The result is the SetMem operation has no effect. The fix is to put the actual parameters in the correct order. Signed-off-by: Chris Stewart Reviewed-by: Liming Gao Reviewed-by: Jiewen Yao Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang --- CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c index ff7f6488f2..970e9b94a0 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c @@ -155,7 +155,7 @@ ConvertAsn1TimeToEfiTime ( } Str = (CONST CHAR8*)Asn1Time->data; - SetMem (EfiTime, 0, sizeof (EFI_TIME)); + SetMem (EfiTime, sizeof (EFI_TIME), 0); Index = 0; if (Asn1Time->type == V_ASN1_UTCTIME) { /* two digit year */ -- 2.39.2