From b3d421700172b1673cb52b17bef676377207ed5a Mon Sep 17 00:00:00 2001 From: sfu5 Date: Wed, 12 Dec 2012 03:03:07 +0000 Subject: Add a NULL string to the Image Execution Information Table if the Name is NULL in function AddImageExeInfo(). Signed-off-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Dong Guo git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13990 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DxeImageVerificationLib/DxeImageVerificationLib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'SecurityPkg') diff --git a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c index c41a379b8a..3b4fc57cb2 100644 --- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c +++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c @@ -715,14 +715,15 @@ AddImageExeInfo ( if (Name != NULL) { NameStringLen = StrSize (Name); + } else { + NameStringLen = sizeof (CHAR16); } - ImageExeInfoTable = NULL; EfiGetSystemConfigurationTable (&gEfiImageSecurityDatabaseGuid, (VOID **) &ImageExeInfoTable); if (ImageExeInfoTable != NULL) { // // The table has been found! - // We must enlarge the table to accmodate the new exe info entry. + // We must enlarge the table to accomodate the new exe info entry. // ImageExeInfoTableSize = GetImageExeInfoTableSize (ImageExeInfoTable); } else { @@ -755,6 +756,8 @@ AddImageExeInfo ( if (Name != NULL) { CopyMem ((UINT8 *) &ImageExeInfoEntry->InfoSize + sizeof (UINT32), Name, NameStringLen); + } else { + ZeroMem ((UINT8 *) &ImageExeInfoEntry->InfoSize + sizeof (UINT32), sizeof (CHAR16)); } CopyMem ( (UINT8 *) &ImageExeInfoEntry->InfoSize + sizeof (UINT32) + NameStringLen, -- cgit v1.2.3