Skip to content

Commit

Permalink
CryptoPkg: BaseCryptLib fix incorrect param order
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Jian J Wang <[email protected]>
Cc: Xiaoyu Lu <[email protected]>
Cc: Guomin Jiang <[email protected]>
  • Loading branch information
Stewart, Chris (SW Architect) via groups.io authored and mergify[bot] committed Aug 24, 2021
1 parent 8dd4fc5 commit 7b4a99b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CryptoPkg/Library/BaseCryptLib/Pk/CryptTs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 7b4a99b

Please sign in to comment.